View Full Version : macro problem


engohubby
11-13-2008, 01:01 AM
I have a button in a form that (opens another form)
with a specific value for a (customer name) field.

what I've got is a blank form with no data
please help me

my email is:engohubby@hotmail.com

:)

wjburke2
11-13-2008, 07:10 AM
I am no expert on macros but why dont you use a click event and pass the name. If you are not looking at posistioning on a record you can use the openArgs to pass the name.

Private Sub btnCamBuild_Click()
On Error GoTo Err_btnCamBuild_Click

Dim stDocName As String
Dim stLinkCriteria As String


stDocName = "CamBuild1"
stLinkCriteria = "[CamId]=" & "'" & Me![txtCamId] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_btnCamBuild_Click:
Exit Sub

Err_btnCamBuild_Click:
MsgBox Err.Description
Resume Exit_btnCamBuild_Click

End Sub