MS access form problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • leemansiuk
    New Member
    • Jun 2006
    • 4

    MS access form problem

    hi,
    i wonder if anyone can help with this problem i cant seem to work out.

    i have a bound form linked to an orders table, including some required fields. when i use the navigation buttons of the form to scroll thorugh the orders i can get to the end where the form expects you to make a new order. but i have a button to add a new order.

    i want to stop the user being able to go past the last record in the orders table. or enable them to get back to the last order. currently if the user goes past the last record (making a new order) there is no way to get back to the last record. using the navigation back button causes errors as the required fields are blank and access tries to save the order, thinking i want to make a new one.

    i hope this makes sense.

    i have tried setting the Allow Additions setting of the Form to No. but this causes problems when there is no data in the orders table. opening the form produces a blank form, showing no fields or buttons at all.

    i would be greatful for any advice, maybe i am doing something fundamentally wrong? :confused:
  • PEB
    Recognized Expert Top Contributor
    • Aug 2006
    • 1418

    #2
    Originally posted by leemansiuk
    hi,
    i wonder if anyone can help with this problem i cant seem to work out.

    i have a bound form linked to an orders table, including some required fields. when i use the navigation buttons of the form to scroll thorugh the orders i can get to the end where the form expects you to make a new order. but i have a button to add a new order.

    i want to stop the user being able to go past the last record in the orders table. or enable them to get back to the last order. currently if the user goes past the last record (making a new order) there is no way to get back to the last record. using the navigation back button causes errors as the required fields are blank and access tries to save the order, thinking i want to make a new one.

    i hope this makes sense.

    i have tried setting the Allow Additions setting of the Form to No. but this causes problems when there is no data in the orders table. opening the form produces a blank form, showing no fields or buttons at all.

    i would be greatful for any advice, maybe i am doing something fundamentally wrong? :confused:
    Hi,

    You have found a good solution with allow addition set to no

    You have to do on Open Event that is activized when the form is open:

    If Me.Recordcount= 0 then
    Me.Allowadditio ns=True
    else
    Me.Allowadditio ns=False
    end if


    Cheers

    :)

    Comment

    Working...