B
Bobk
I have a form where bookings are entered. Each booked order (each record) has
a button which opens a form that shows the purchase orders that are in place
for the specific order in the bookings table. The code for the button is:
Private Sub Command42_Click()
On Error GoTo Err_Command42_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmBkingsPO"
stLinkCriteria = "[pojobnumber]=" & "'" & Me![bkjobno] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command42_Click:
Exit Sub
Err_Command42_Click:
MsgBox Err.Description
Resume Exit_Command42_Click
End Sub
After opening the form frmBkingsPO I can select any line item on the
bookings form
and the frmBkingsPO form will update correctly. On the frmBkingsPO form I
have another button for each purchase order that is listed. This button opens
a purchase order entry form. So far I can get the purchase order entry form
to open, but I don't know how to get the specific corresponding purchase
order data to be displayed. The code for the button is:
Private Sub Command5_Click()
On Error GoTo Err_Command5_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Purchase Order Entry"
stLinkCriteria = "[ponumber]=" & Me![ponumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormPropertySettings
Exit_Command5_Click:
Exit Sub
Err_Command5_Click:
MsgBox Err.Description
Resume Exit_Command5_Click
End Sub
The purchase order entry form normally opens in data entry mode and is ready
for the entry of new data. On open the following code is executed.
Private Sub Form_Open(Cancel As Integer)
DoCmd.OpenForm "Purchase Order Entry"
DoCmd.GoToRecord , , acNewRec
End Sub
This is for data entry of new purchase orders which is normally what happens.
What I want to do is open the purchase order entry form and display the
purchase order data associated with the record selected in the frmBkingsPO.
How can I overide the "on open" command and automatically go to the selected
frmBkingsPO record and display its unique data?
a button which opens a form that shows the purchase orders that are in place
for the specific order in the bookings table. The code for the button is:
Private Sub Command42_Click()
On Error GoTo Err_Command42_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmBkingsPO"
stLinkCriteria = "[pojobnumber]=" & "'" & Me![bkjobno] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command42_Click:
Exit Sub
Err_Command42_Click:
MsgBox Err.Description
Resume Exit_Command42_Click
End Sub
After opening the form frmBkingsPO I can select any line item on the
bookings form
and the frmBkingsPO form will update correctly. On the frmBkingsPO form I
have another button for each purchase order that is listed. This button opens
a purchase order entry form. So far I can get the purchase order entry form
to open, but I don't know how to get the specific corresponding purchase
order data to be displayed. The code for the button is:
Private Sub Command5_Click()
On Error GoTo Err_Command5_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Purchase Order Entry"
stLinkCriteria = "[ponumber]=" & Me![ponumber]
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormPropertySettings
Exit_Command5_Click:
Exit Sub
Err_Command5_Click:
MsgBox Err.Description
Resume Exit_Command5_Click
End Sub
The purchase order entry form normally opens in data entry mode and is ready
for the entry of new data. On open the following code is executed.
Private Sub Form_Open(Cancel As Integer)
DoCmd.OpenForm "Purchase Order Entry"
DoCmd.GoToRecord , , acNewRec
End Sub
This is for data entry of new purchase orders which is normally what happens.
What I want to do is open the purchase order entry form and display the
purchase order data associated with the record selected in the frmBkingsPO.
How can I overide the "on open" command and automatically go to the selected
frmBkingsPO record and display its unique data?