Results 1 to 5 of 5

Thread: Syntax Error

  1. #1
    Join Date
    May 2004
    Posts
    55

    Unanswered: Syntax Error

    This is what I want to do:

    If IsNull(varX) Then MsgBox "Success" & DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 Else MsgBox "Fail" & DoCmd.RunCommand acCmdUndo

    How do I do this?

    Thanks,

    D

  2. #2
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Code:
    If IsNull(varX) Then 
      MsgBox "Success"
      MsgBox "Success2"
    Else 
      MsgBox "Fail"
      MsgBox "Fail2"
    End If
    Last edited by r123456; 07-06-04 at 22:37.
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  3. #3
    Join Date
    May 2004
    Posts
    55
    Quote Originally Posted by r123456
    Code:
    If IsNull(varX) Then 
      MsgBox "Success"
      MsgBox "Success2"
    Else 
      MsgBox "Fail"
      MsgBox "Fail2"
    End If

    Thanks!! that works but i was wondering if I could delete the record but not clear the data in the text boxes, which means the user has to restart the procedure of reserving an item. Is there a way to just say the reservation failed , do not clear the text boxes and also do not add the record to the table 'HISTORY'. Does that make sense?

  4. #4
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    You do not need to delete the record, instead do not insert the record should the data not be valid.
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  5. #5
    Join Date
    May 2004
    Posts
    55
    Quote Originally Posted by r123456
    You do not need to delete the record, instead do not insert the record should the data not be valid.

    How do I do that? When I use the command DoCmd.RunCommand acCmdUndo
    it deletes that record and clears all the text boxes on the form. Is there another command that says do not insert or something.

Posting Permissions

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