Real Wally
Registered User.
- Local time
- Today, 06:29
- Joined
- Jan 28, 2003
- Messages
- 107
Hi All,
I have a problem with opening a secondary form from the main form.
Tha main frm is called frmPatents and it’s based on a tabel.
I need to open a secondary form (frmAllOfficialAction_Patents) by clicking a button (bAddOffAction). This secondary form is based on query (qrytblPatents_tblOffActions).
All goes well for patents that already have previous records of an Official Action. The linking field (PublicationNum) is present in both tables and open up fine, a new record can be opened from the form.
However, if this is the first Official Action for a patent I have a problem.
I get the error message: Syntax error (operator missing) in query expression ‘[PublicationNum]= testPatentnumber’
What I need to happen is that the secondary form copies the value in the linking field (PublicationNum) + a few other text fields to matching ones in the new record on frmAllOfficialAction_Patents. I cannot get that done.
With the code I’ve got now I get filled in forms for exicting records and a get blanc forms for new records. Not blanc in the sense that the fields are empty, but blanc in the sense that there’s nothing there, no labels, no field, nothing except the close button in the form footer. I don’t get it! Please advice.
Button:
Private Sub AddOffAction_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAllOfficialAction_Patents"
stLinkCriteria = "[PublicationNum]=" & "'" & Me![PublicationNum] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
Thanks a million,
Wally
I have a problem with opening a secondary form from the main form.
Tha main frm is called frmPatents and it’s based on a tabel.
I need to open a secondary form (frmAllOfficialAction_Patents) by clicking a button (bAddOffAction). This secondary form is based on query (qrytblPatents_tblOffActions).
All goes well for patents that already have previous records of an Official Action. The linking field (PublicationNum) is present in both tables and open up fine, a new record can be opened from the form.
However, if this is the first Official Action for a patent I have a problem.
I get the error message: Syntax error (operator missing) in query expression ‘[PublicationNum]= testPatentnumber’
What I need to happen is that the secondary form copies the value in the linking field (PublicationNum) + a few other text fields to matching ones in the new record on frmAllOfficialAction_Patents. I cannot get that done.
With the code I’ve got now I get filled in forms for exicting records and a get blanc forms for new records. Not blanc in the sense that the fields are empty, but blanc in the sense that there’s nothing there, no labels, no field, nothing except the close button in the form footer. I don’t get it! Please advice.
Button:
Private Sub AddOffAction_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmAllOfficialAction_Patents"
stLinkCriteria = "[PublicationNum]=" & "'" & Me![PublicationNum] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
Thanks a million,
Wally