DaveCollins181
Registered User.
- Local time
- Today, 11:26
- Joined
- Oct 27, 2014
- Messages
- 45
I have created a command button on a form called FrmJobs. It opens a form called FrmPurchaseOrders, adds a new record and gives the JobID field in FrmPurchaseOrders the same entry as the JobID field from the form FrmJobs:
The following Event Procedure works on my previous database but when I try on my new database, I get an error message (See below for error):-
Private Sub Command214_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FrmPurchaseOrders"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acNewRec
Forms![FrmPurchaseOrders].[JobID] = Forms![FrmJobs].[JobID]
Exit_Command214_Click:
Exit Sub
Err_Command214_Click:
MsgBox Err.Description
Resume Exit_Command214_Click
End Sub
ERROR MESSAGE: Microsoft Visual Basic - Run-time error '438': Object doesn't support this property or method
The above script work up until the point Forms![FrmPurchaseOrders].[JobID] = Forms![FrmJobs].[JobID]. Does anyone have any idea how to overcome? If there is a Macro or some other code that would provide the same result then that would be great.
Thanks, David
The following Event Procedure works on my previous database but when I try on my new database, I get an error message (See below for error):-
Private Sub Command214_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FrmPurchaseOrders"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acNewRec
Forms![FrmPurchaseOrders].[JobID] = Forms![FrmJobs].[JobID]
Exit_Command214_Click:
Exit Sub
Err_Command214_Click:
MsgBox Err.Description
Resume Exit_Command214_Click
End Sub
ERROR MESSAGE: Microsoft Visual Basic - Run-time error '438': Object doesn't support this property or method
The above script work up until the point Forms![FrmPurchaseOrders].[JobID] = Forms![FrmJobs].[JobID]. Does anyone have any idea how to overcome? If there is a Macro or some other code that would provide the same result then that would be great.
Thanks, David
Last edited: