If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
link subform to other form
Hello, I am trying to use a subform (which works great so far) to enter
data. I have a one to one relationship on the main form and sub form with enforce referential integrity selected( cascade update/deleted selected too). I placed a button in my subform that activates another form where the user can enter more data. This form is on a separate table as well as the main and subform. How can I get the popup form data to relate to the main and subform? I checked enforce referential integrity, cascade update/delete in my relationship but the data entered is the same for all records. HELP! TIA Troy |
#2
|
|||
|
|||
link subform to other form
To open another form linked to some value on your current form, include
something like the code below in the on click event that opens the new form: '================================================= ===== Dim stDocName As String Dim stLinkCriteria As String stDocName = "frmNewForm" stLinkCriteria = "[MyID]=" & Forms![frmMainForm].Form![frmMysub]![MyID] If IsNull(Forms![frmMainForm].Form![frmMysub]![MyValue]) Then MsgBox "Enter a Record before selecting New Form" Else DoCmd.OpenForm stDocName, , , stLinkCriteria End If '================================================= ==== -Ed "Troy Scott mindspring.com" tigerweldremovebrakets wrote in message ... Hello, I am trying to use a subform (which works great so far) to enter data. I have a one to one relationship on the main form and sub form with enforce referential integrity selected( cascade update/deleted selected too). I placed a button in my subform that activates another form where the user can enter more data. This form is on a separate table as well as the main and subform. How can I get the popup form data to relate to the main and subform? I checked enforce referential integrity, cascade update/delete in my relationship but the data entered is the same for all records. HELP! TIA Troy |
#3
|
|||
|
|||
link subform to other form
Why won't it link to the same record like the subform
does? Troy -----Original Message----- To open another form linked to some value on your current form, include something like the code below in the on click event that opens the new form: '================================================ ====== Dim stDocName As String Dim stLinkCriteria As String stDocName = "frmNewForm" stLinkCriteria = "[MyID]=" & Forms![frmMainForm].Form! [frmMysub]![MyID] If IsNull(Forms![frmMainForm].Form![frmMysub]! [MyValue]) Then MsgBox "Enter a Record before selecting New Form" Else DoCmd.OpenForm stDocName, , , stLinkCriteria End If '================================================ ===== -Ed "Troy Scott mindspring.com" tigerweldremovebrakets wrote in message ... Hello, I am trying to use a subform (which works great so far) to enter data. I have a one to one relationship on the main form and sub form with enforce referential integrity selected( cascade update/deleted selected too). I placed a button in my subform that activates another form where the user can enter more data. This form is on a separate table as well as the main and subform. How can I get the popup form data to relate to the main and subform? I checked enforce referential integrity, cascade update/delete in my relationship but the data entered is the same for all records. HELP! TIA Troy . |
#4
|
|||
|
|||
link subform to other form
Hey Ed, I tried that code but I kept getting errors.
Could you possibly be a little more help? My main form is frmMain, my subform is frmMainSub. Would it be any better if I place the command button just outside of the subform? Would that help? Thanks! Troy -----Original Message----- To open another form linked to some value on your current form, include something like the code below in the on click event that opens the new form: '================================================ ====== Dim stDocName As String Dim stLinkCriteria As String stDocName = "frmNewForm" stLinkCriteria = "[MyID]=" & Forms![frmMainForm].Form! [frmMysub]![MyID] If IsNull(Forms![frmMainForm].Form![frmMysub]! [MyValue]) Then MsgBox "Enter a Record before selecting New Form" Else DoCmd.OpenForm stDocName, , , stLinkCriteria End If '================================================ ===== -Ed "Troy Scott mindspring.com" tigerweldremovebrakets wrote in message ... Hello, I am trying to use a subform (which works great so far) to enter data. I have a one to one relationship on the main form and sub form with enforce referential integrity selected( cascade update/deleted selected too). I placed a button in my subform that activates another form where the user can enter more data. This form is on a separate table as well as the main and subform. How can I get the popup form data to relate to the main and subform? I checked enforce referential integrity, cascade update/delete in my relationship but the data entered is the same for all records. HELP! TIA Troy . |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Filter Problems on Main form & Subform | Jeff | Using Forms | 2 | July 7th, 2004 03:13 PM |
Pop up form doesn't link correctly, PLEASE HELP!!! | Sandra | Using Forms | 4 | June 19th, 2004 01:55 AM |
Recordset in subform based on field in parent form | Lyn | General Discussion | 15 | June 14th, 2004 03:10 PM |
Filter subform combobox on option button in main form | Emma | Using Forms | 1 | June 12th, 2004 12:24 AM |
Pulling sum of a subform to another form | DDarney | Using Forms | 1 | May 26th, 2004 07:01 PM |