G
Guest
This is my first data base design And I have problem with DoCmd.OpenForm
command
I have a table Car order Table (OrderID -- primary key.) I created form
“Order ID by Customer†where I can look at all orders based on a customer. On
that form I created “OrderID Subform†that is showing a few detail fields
regarding specific order. I would like to select specific orderid on a
subform and would like to go to another form called “Car Order Form†that
would show me all details regarding this order. I created command button
(View Order Detail )and assigned code
Private Sub ExpenseReport_Click()
On Error GoTo Err_ExpenseReport_Click
If IsNull(Me![CustomerID]) Then
MsgBox "Enter customer before entering customer report."
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "Car Order Form", , , "[OrderID] = " & [OrderID], ,
acDialog
End If
Exit_ExpenseReport_Click:
Exit Sub
Err_ExpenseReport_Click:
MsgBox Err.Description
Resume Exit_ExpenseReport_Click
End Sub
I am receiving error message when highlighting specific order and clicking
on View Order Detail command button in line:
DoCmd.OpenForm "Car Order Form", , , "[OrderID] = " & [OrderID], , acDialog
Syntax error (missing operator) in query expression ‘[OrderID] = ‘
OrderID primary key is set as AutoNumber.
Thanks for your help
command
I have a table Car order Table (OrderID -- primary key.) I created form
“Order ID by Customer†where I can look at all orders based on a customer. On
that form I created “OrderID Subform†that is showing a few detail fields
regarding specific order. I would like to select specific orderid on a
subform and would like to go to another form called “Car Order Form†that
would show me all details regarding this order. I created command button
(View Order Detail )and assigned code
Private Sub ExpenseReport_Click()
On Error GoTo Err_ExpenseReport_Click
If IsNull(Me![CustomerID]) Then
MsgBox "Enter customer before entering customer report."
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "Car Order Form", , , "[OrderID] = " & [OrderID], ,
acDialog
End If
Exit_ExpenseReport_Click:
Exit Sub
Err_ExpenseReport_Click:
MsgBox Err.Description
Resume Exit_ExpenseReport_Click
End Sub
I am receiving error message when highlighting specific order and clicking
on View Order Detail command button in line:
DoCmd.OpenForm "Car Order Form", , , "[OrderID] = " & [OrderID], , acDialog
Syntax error (missing operator) in query expression ‘[OrderID] = ‘
OrderID primary key is set as AutoNumber.
Thanks for your help