S
saraqpost
I want to pass the customer name (first and last) and the ID for the
customer from the customer form to the items form, so the user can add
a new item for the customer.
I keep getting the message "missing operator" - but the strLinkCriteria
looks right to me.
The txtCustomer box on the frmItem is unbound, named txtCustomer. I
have tried =FirstName & " " & LastName for the control source for the
field, and once I got the form to open (I took off open as DE) but the
field said "#Name".
Can someone tell me what I'm missing?
' Open frmItems in DE mode
' Bring over the Customer name and ID to the form
Dim lngCustID As Long
Dim txtFirstName As String
Dim txtLastName As String
Dim stLinkCriteria As String
Dim stDocName As String
lngCustID = Me.lngCustID
txtFirstName = Me.txtFirstName
txtLastName = Me.txtLastName
stDocName = "frmItems"
stLinkCriteria = "CustID =" & lngCustID & " AND txtCustomer =" _
& txtFirstName & " " & txtLastName
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd
Thank you very much.
customer from the customer form to the items form, so the user can add
a new item for the customer.
I keep getting the message "missing operator" - but the strLinkCriteria
looks right to me.
The txtCustomer box on the frmItem is unbound, named txtCustomer. I
have tried =FirstName & " " & LastName for the control source for the
field, and once I got the form to open (I took off open as DE) but the
field said "#Name".
Can someone tell me what I'm missing?
' Open frmItems in DE mode
' Bring over the Customer name and ID to the form
Dim lngCustID As Long
Dim txtFirstName As String
Dim txtLastName As String
Dim stLinkCriteria As String
Dim stDocName As String
lngCustID = Me.lngCustID
txtFirstName = Me.txtFirstName
txtLastName = Me.txtLastName
stDocName = "frmItems"
stLinkCriteria = "CustID =" & lngCustID & " AND txtCustomer =" _
& txtFirstName & " " & txtLastName
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd
Thank you very much.