General discussion
-
Topic
-
Access VBA coding problem
LockedCan anyone help me please?? I have a field on an Access report called “Company name”. I have a command button in place that runs VBA code. This code is suppose to trap the text input of the user and then store in on the report field called “Company Name”. How ever when I click the button and fire the code, I get an error message telling me that the field name is incorrect, or renamed or deleted. My code reads as follows:
Private Sub Command159_Click()
On Error GoTo Err_Command159_ClickDim stDocName As String
stDocName = “Order Questionaire”
DoCmd.OpenReport stDocName, acPreviewDim MyPrompt As String
InputBox “Enter Company Name:”Me!MyPrompt = [Company Name]
Exit_Command159_Click:
Exit SubErr_Command159_Click:
MsgBox Err.Description
Resume Exit_Command159_ClickEnd Sub
Any idea’s? It’s worth a case of beer to someone!