You're going to have to provide more information if you expect anyone to
provide meaningful help. All we can do at this point is guess. Start by
showing the code that you are using. Note that the InputBox function returns
a string value. Is your OrderNumber numeric (for example, an autonumber
datatype or long integer)? If this is the case, then you'll need to use a
type conversion function to convert the string. For example:
lngOrderNumber = CLng(InputBox(Message, Title))
Here is an example that might work for you. If not, then post back with more
details.
'*******************Begin Code*************************
Option Compare Database
Option Explicit
Private Sub cmdOK_Click()
On Error GoTo ProcError
Dim strMessage As String
Dim strTitle As String
Dim lngOrderNumber As Long
strMessage = "Enter Order ID: "
strTitle = "Open Form to Specified Order..."
lngOrderNumber = CLng(InputBox(strMessage, strTitle))
DoCmd.OpenForm "YourFormName", _
WhereCondition:="OrderNumber = " & lngOrderNumber
ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure cmdOK_Click..."
Resume ExitProc
End Sub
'*******************End Code***************************
Tom
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
:
I want to open a form to a certin record (using OrderNumber) that is enter
into a inputbox by customer. I keep getting an Error msg saying I cannot do
this. Why?