Results 1 to 10 of 10
  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 on which customer information is entered. After completing the information, the operator presses the Check In command button on frmCustomerEntry. At this point I am trying to save the customer information so it will be available when frmCheckIn is opened.

    When the check In button is clicked, I am getting a run time error 2046. The command or action ĎSave Recordí isnít available.

    Private Sub Check_In_Click()
    If Me.Dirty Then
    If IsNull(Me.CompanyOrDepartment) Then
    Me.CompanyOrDepartment.SetFocus
    MsgBox "Company Name is required. Enter 'None' if no company name is available", vbExclamation
    Cancel = True
    Exit Sub
    End If
    RunCommand acCmdSaveRecord
    End If

    DoCmd.OpenForm "frmCheckIn", , , "RentPaidDate Between ReportBeg and ReportEnd"
    DoCmd.GoToRecord acDataForm, "frmCheckIn", acNewRec
    Forms!frmCheckIn!CustomerID = Me.CustomerID
    Forms!frmCheckIn![Res#] = Me.ReservationNumber
    Me.ReservationNumber = Null
    Forms!frmCheckIn!ResBegDte = Me.ResBegDate
    Me.ResBegDate = Null
    Forms!frmCheckIn!ResEndDte = Me.ResEndDate
    Me.ResEndDate = Null
    Forms!frmCheckIn![IATA#] = Me.IATANumber
    Me.IATANumber = Null
    Forms!frmCheckIn![ResID#] = Me.ResID
    Me.ResID = Null
    Me.CustomerStatusID = 1

    End Sub

    Any assistance would be greatly appreciated.

    Tom Goodwin

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    You are trying to Save in a context where Access cannot Save.
    What is there in the context that makes it impossible to Save?
    • One option is that the form is based on a non-updateable query - but in that case you would not be able to enter anything at all.
    • Does the data comply with all requirements set at a table level? Required fields?
    • Is the form bound or unbound?
    Might you be able to post a stripped down copy of the db?
    Regards
    John



  3. #3
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If you close frmCustomerEntry without clicking on the Check In button, all of the information is saved correctly. If you reopen frmCustomerEntry and use the locate record functon for the record just saved, the Check In function works as it is surposed to.

    I am traveling but will post a stripped down version as soon as possible.

    Thanks,

    Tom




    [quote name='johnhutchison' post='793246' date='14-Sep-2009 02:04']You are trying to Save in a context where Access cannot Save.
    What is there in the context that makes it impossible to Save?
    • One option is that the form is based on a non-updateable query - but in that case you would not be able to enter anything at all.
    • Does the data comply with all requirements set at a table level? Required fields?
    • Is the form bound or unbound?
    Might you be able to post a stripped down copy of the db?[/quote]

  4. #4
    4 Star Lounger
    Join Date
    Dec 2002
    Location
    Kitchener, Ontario, Canada
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='TomGoodwin' post='793206' date='13-Sep-2009 15:48']Private Sub Check_In_Click()
    If Me.Dirty Then
    If IsNull(Me.CompanyOrDepartment) Then
    Me.CompanyOrDepartment.SetFocus
    MsgBox "Company Name is required. Enter 'None' if no company name is available", vbExclamation
    Cancel = True
    Exit Sub
    End If
    RunCommand acCmdSaveRecord
    End If[/quote]

    Try Docmd.Runcommand acCmdSaveRecord

  5. #5
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the suggestion. I had previously tried this to no avail. Tried again, also to no avail.

    I will post a stripped down database in a few minutes.

    Tom


    quote name='PeterN' date='14-Sep-2009 12:06' post='793293']
    Try Docmd.Runcommand acCmdSaveRecord
    [/quote]

  6. #6
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am attaching a stripped down database. Thanks for looking at it.

    Tom Goodwin[attachment=85525:Woody.zip]


    [quote name='johnhutchison' post='793246' date='14-Sep-2009 02:04']You are trying to Save in a context where Access cannot Save.
    What is there in the context that makes it impossible to Save?
    • One option is that the form is based on a non-updateable query - but in that case you would not be able to enter anything at all.
    • Does the data comply with all requirements set at a table level? Required fields?
    • Is the form bound or unbound?
    Might you be able to post a stripped down copy of the db?[/quote]
    Attached Files Attached Files

  7. #7
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    [quote name='TomGoodwin' post='793308' date='15-Sep-2009 06:41']I am attaching a stripped down database. Thanks for looking at it.[/quote]

    I have looked at the attachment, but it does not give the error for me!
    I have tried a few things, but can't see anything to suggest.
    I am confused by the form frmCustomerEntry.
    It has its Data Entry property set to yes, but it shows existing records.
    It has the Allow Edits property set to No, but allows changes.
    Regards
    John



  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    [quote name='johnhutchison' post='793324' date='15-Sep-2009 00:48']I am confused by the form frmCustomerEntry.
    It has its Data Entry property set to yes, but it shows existing records.
    It has the Allow Edits property set to No, but allows changes.[/quote]
    The On Open event of the form runs the macro mcrDisplayAll which undoes the Data Entry setting. In Access 2002, I can't edit the existing records, but after clicking Add New, I can obviously modify the new record.

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I only get an error message if not all required fields have been entered. As in an earlier topic, you need to perform checks before trying to save the record.

  10. #10
    4 Star Lounger
    Join Date
    May 2002
    Location
    Roanoke, Virginia, USA
    Posts
    493
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry for the delay in responding. I was traveling and did not have access to a computer.

    When the frmCustomer is first opened, the first record in the table is displayed. We were having a problem with the operator changing information in the displayed record by mistake so we locked the record. We put in the find last function so the operator would check to see if a new customer was already in the database. If the customer record is found, then it can be edited. Once the operator uses Enter New, then a new blank record is displayed and the new customer can be entered.

    The problem with the CheckIn function seems to be intermittent. I have not yet fully determined whether or not it might be operating system related. When the user first reported the problem I was traveling. I first looked at the problem on a laptop computer using Vista (horrible operating system) and experienced the same problem the user was having.

    I tried it on my office system this morning and it worked fine. I am using Windows XP home edition on my office computer. I have E-mailed the user this morning to see if she is still experiencing the problem. I think they are using Windows XP home edition but I am not sure. I will verify later today. There are up to 16 users using the system on a stand alone basis and no one else has reported a problem. Will inquire of all users in the near future to see if they have ever experienced this problem. They generally are good about reporting abnormal conditions.

    Thanks for your assistance.

    Tom



    [quote name='HansV' post='793633' date='16-Sep-2009 19:13']The On Open event of the form runs the macro mcrDisplayAll which undoes the Data Entry setting. In Access 2002, I can't edit the existing records, but after clicking Add New, I can obviously modify the new record.[/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
  •