Results 1 to 5 of 5

Thread: Invalid Entry

  1. #1
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271

    Question Unanswered: Invalid Entry

    Our salesmen fill out a Work Order request to get a Work Order done.
    The Work Order uses the RequestID number from the Request for Work Order to transfer much of the data to keep from retyping data:


    Private Sub RequestID_AfterUpdate()
    ' Update Physical controls based on value selected in RequestID combo box.
    Me!Salesman = Me!RSalesman
    Me!StartDate = Me!RDate
    Me!StartTime = Me!RStartTime
    Me!CustomerOrderNo = Me!RPONum
    Me!ContactName = Me!RContact
    End Sub

    If the person doing the work order types in an invalid RequestID number I get a generic error message.
    I don't know the proper code so I will put it in English
    I would like to enter code to say ??

    Private Sub RequestID_AfterUpdate()
    If RequestID(FormWorkOrder) <> RequestID(RequestTable) then
    MsgBox("Please enter a valid Request ID number")
    Then take me back to the combo box I was in
    Else' Update Physical controls based on value selected in RequestID combo box.
    Me!Salesman = Me!RSalesman
    Me!StartDate = Me!RDate
    Me!StartTime = Me!RStartTime
    Me!CustomerOrderNo = Me!RPONum
    Me!ContactName = Me!RContact
    End Sub

    Any help would be greatly appreciated!

    Michael
    Gotta to do some code

  2. #2
    Join Date
    Apr 2004
    Location
    South Arica
    Posts
    125
    Code:
    Private sub RequestID_BeforeUpdate(Cancel as Integer)
    
    If RequestID(FormWorkOrder) <> RequestID(RequestTable) then
      MsgBox("Please enter a valid Request ID number") 
      Cancel = True ' it may be 1, not too sure
    Else' Update Physical controls based on value selected in RequestID combo box.
      Me!Salesman = Me!RSalesman
      Me!StartDate = Me!RDate
      Me!StartTime = Me!RStartTime
      Me!CustomerOrderNo = Me!RPONum
      Me!ContactName = Me!RContact
    End If
    
    End Sub

  3. #3
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271
    I get a type mismatch when I try to enter the following?


    If RequestID(FormWorkOrderData) <> RequestID(RequestTbl) Then
    Gotta to do some code

  4. #4
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271
    This is not written write is it?
    If RequestID(FormWorkOrderData) <> RequestID(RequestTbl) Then
    Gotta to do some code

  5. #5
    Join Date
    Mar 2004
    Location
    Greenville, SC
    Posts
    271
    I tried this and it gave me an error
    Runtime error 424
    Object required


    If (RequestTbl!RequestID) <> (Me!RequestID) Then
    Gotta to do some code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •