Results 1 to 10 of 10
  1. #1
    mokje5 is offline Novice
    Windows 10 Access 2013
    Join Date
    Dec 2015
    Posts
    10

    Form not working after editing a new record

    Hey,

    I have a form with a combobox, where you can select a movie.
    When a movie is selected, the corresponding information is shown in comboboxes, which you can use to change/view data about the selected movie.
    There is also a button to create a new blank record to add a new movie, this button uses the following VBA:
    Code:
    DoCmd.GoToRecord , , acNewRec
    Me.save_button.Visible = True
    The above works fine, I can use the newly created blank record to make a new movie, and insert it in the database.
    But when I try to click on a movie in the combobox AFTER adding a new movie it doesn't show the info of the movie.
    I've tried to use Me.Refresh, Me.Requery but those just result in errors when using them after making the new record.
    Also, the problem starts occurring when info is typed into the newly created record.
    When nothing is typed in, you can just click on a movie in the combobox and it will show the info.



    I hope you guys can help!

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Not real sure what you are doing but have you saved the "new" record yet?

  3. #3
    mokje5 is offline Novice
    Windows 10 Access 2013
    Join Date
    Dec 2015
    Posts
    10
    Yes, there is a save button with a query.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Have you "requeried" the ComboBox? Me.ComboBoxName.Requery

  5. #5
    mokje5 is offline Novice
    Windows 10 Access 2013
    Join Date
    Dec 2015
    Posts
    10
    Yup, it doesn't change the situation unfortunatly.
    I've just discovered that when using the record navigator at the bottom(the new record does in fact get saved), I get this error after saving the new record.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    So SQL Server is your back end?

  7. #7
    mokje5 is offline Novice
    Windows 10 Access 2013
    Join Date
    Dec 2015
    Posts
    10
    Yes it is indeed.

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Movie-id is not a nullable column. Before you can navigate from one record to another, you need to provide values for each column that is not nullable.

    After navigating to a new record, if you do not type anything into any of the controls, you can navigate back to previous records. This is because Access is not trying to save a new record. You did not enter anything, so the new record is aborted.

  9. #9
    mokje5 is offline Novice
    Windows 10 Access 2013
    Join Date
    Dec 2015
    Posts
    10
    Quote Originally Posted by ItsMe View Post
    Movie-id is not a nullable column. Before you can navigate from one record to another, you need to provide values for each column that is not nullable.

    After navigating to a new record, if you do not type anything into any of the controls, you can navigate back to previous records. This is because Access is not trying to save a new record. You did not enter anything, so the new record is aborted.
    What would be the easiest way to solve this problem?

  10. #10
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Provide a value for Move_id before navigating to a new record or closing the form.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 07-31-2015, 12:03 PM
  2. Replies: 7
    Last Post: 02-18-2015, 10:13 PM
  3. Replies: 13
    Last Post: 01-22-2015, 05:27 PM
  4. Replies: 7
    Last Post: 05-02-2013, 02:10 AM
  5. Replies: 0
    Last Post: 10-16-2008, 02:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums