Results 1 to 5 of 5

Thread: Saving Records

  1. #1
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a frmCustomerEntry that serves two purposes. First, it allows a Customer to be entered into tblCustomer. Second, it allows a Customer to be checked in using frmCheckIn and that record is stored in tblRental.

    If a customer is entered and the form is closed thereby saving the record to tblCustomer everything works fine. If frmCustomerEnter is then re-opened and the find Last function is used to open the customer record just entered, and then the CheckIn button is clicked thereby opening frmCheckIn, the Rental record can be entered with no problems.

    If the customer record is entered on frmCustomerEntry and then the CheckIn button is clicked, frmCustomerCheckIn opens. The Customer can not be found on the drop down menu for the customer name. I think this is because the Customer Record has not been saved. What I think I need is for the just entered customer Record to be saved so it can be available to frmCheckIn. In the past it was working fine by just saving the customer record but now I need to save some information from the Customer record to the Rental record and then delete information from the customer record. Those functions are working properly when the customer record has been saved

    I think what I need is to be able to save the Customer record and then immediately reopen it so the customer record is available to check in the customer on frmCheckIn.

    Any assistance would be greatly appreciated.
    [attachment=84958:WoodyTest_Copy.zip]
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You could add code before opening frmCheckin:

    Code:
      If Me.Dirty Then
    	' Perform checks here and exit if the record doesn't pass a test
    	...
    	...
    	RunCommand acCmdSaveRecord
      End If

  3. #3
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks. That worked.

    It is my understand that is you have Me.Invoiced= -1, that Me refers to the current form. If you have to forms open frmCustomerEntry and frmCheckIn, what is the proper syntex to make the "Invoiced" field in frmCustomer Entry = -1.

    Tom




    [quote name='HansV' post='787328' date='03-Aug-2009 10:36']You could add code before opening frmCheckin:

    Code:
      If Me.Dirty Then
    	' Perform checks here and exit if the record doesn't pass a test
    	...
    	...
    	RunCommand acCmdSaveRecord
      End If
    [/quote]

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    To set Invoiced on frmCustomerEntry to -1 in code from frmCheckIn:

    Forms!frmCustomerEntry!Invoiced = -1

    or to set Invoiced on frmCheckIn to -1 in code from frmCustomerEntry:

    Forms!frmCheckIn!Invoiced = -1

  5. #5
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you for your assistance.

    Tom

    [quote name='HansV' post='787361' date='03-Aug-2009 14:36']To set Invoiced on frmCustomerEntry to -1 in code from frmCheckIn:

    Forms!frmCustomerEntry!Invoiced = -1

    or to set Invoiced on frmCheckIn to -1 in code from frmCustomerEntry:

    Forms!frmCheckIn!Invoiced = -1[/quote]

Posting Permissions

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