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
|
|||
|
|||
Opening a Form
I have 2 forms that are tied to the same record. My Key Field is a Customer
Order Number That is Created on the Fly but not autonumber. I didn't use the 2nd. form as a subform because it is as large as the 1st. and really would not apply to the scheme of things. If I open the 1st. form in edit view and use the button to navigate to the 2nd. form all is okay. But if I am entering a New Record, the 2nd form does not populate the Table. How do I adjust my coding for this. I am kinda lost here. Code for the button follows: Private Sub Command235_Click() On Error GoTo Err_Command235_Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "Logistics & Routing" stLinkCriteria = "[CustOrderNum]=" & Me![BillOfLadingTxt] DoCmd.OpenForm stDocName, , , stLinkCriteria Exit_Command235_Click: Exit Sub Err_Command235_Click: MsgBox Err.Description Resume Exit_Command235_Click End Sub Thanks |
#2
|
|||
|
|||
Opening a Form
You will need to save the record before the 2nd form can see it. Before
opening the other form add If Me.Dirty then Me.Dirty = False ...to save the record. Hank wrote: I have 2 forms that are tied to the same record. My Key Field is a Customer Order Number That is Created on the Fly but not autonumber. I didn't use the 2nd. form as a subform because it is as large as the 1st. and really would not apply to the scheme of things. If I open the 1st. form in edit view and use the button to navigate to the 2nd. form all is okay. But if I am entering a New Record, the 2nd form does not populate the Table. How do I adjust my coding for this. I am kinda lost here. Code for the button follows: Private Sub Command235_Click() On Error GoTo Err_Command235_Click Dim stDocName As String Dim stLinkCriteria As String stDocName = "Logistics & Routing" stLinkCriteria = "[CustOrderNum]=" & Me![BillOfLadingTxt] DoCmd.OpenForm stDocName, , , stLinkCriteria Exit_Command235_Click: Exit Sub Err_Command235_Click: MsgBox Err.Description Resume Exit_Command235_Click End Sub Thanks -- RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP WinXP Pro Please post back to this forum so all may benefit. Message posted via http://www.accessmonster.com |
Thread Tools | |
Display Modes | |
|
|