L
Linda
I am trying to open a form based on an entry in a combo box. My select
statement for the comob box is:
SELECT VENDOR.vCODE, VENDOR.VENDOR FROM VENDOR ORDER BY VENDOR.VENDOR,
VENDOR.vCODE;
The event procedure is:
Private Sub cmdOpenForm_Click()
On Error GoTo Err_cmdOpenForm_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Edit Vendor"
stLinkCriteria = "[VCODE]=" & Me![cboentercode]
DoCmd.OpenForm stDocName, , stLinkCriteria, acFormEdit
Exit_cmdOpenForm_Click:
Exit Sub
Err_cmdOpenForm_Click:
MsgBox Err.DESCRIPTION
Resume Exit_cmdOpenForm_Click
End Sub
When you click the command button, all the records show instead the chosen
record, based on the vendor code or vcode. I can't figure out where the
problem is. Can anyone help?
statement for the comob box is:
SELECT VENDOR.vCODE, VENDOR.VENDOR FROM VENDOR ORDER BY VENDOR.VENDOR,
VENDOR.vCODE;
The event procedure is:
Private Sub cmdOpenForm_Click()
On Error GoTo Err_cmdOpenForm_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Edit Vendor"
stLinkCriteria = "[VCODE]=" & Me![cboentercode]
DoCmd.OpenForm stDocName, , stLinkCriteria, acFormEdit
Exit_cmdOpenForm_Click:
Exit Sub
Err_cmdOpenForm_Click:
MsgBox Err.DESCRIPTION
Resume Exit_cmdOpenForm_Click
End Sub
When you click the command button, all the records show instead the chosen
record, based on the vendor code or vcode. I can't figure out where the
problem is. Can anyone help?