Results 1 to 11 of 11
  1. #1
    ItsRoland is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    111

    Issues with Data Entry and viewing data in form

    I'm creating a form with multiple subforms in access 2016



    I'm having issues getting anything (form and subforms) to allow me to enter any data. I've set Data-Entry, allow additions, allow edits, etc. to yes and no in a variety of combinations with no luck. I've made sure I'm changing both the form properties and the subform properties.

    When I select "yes" for data entry, it displays "(new)" in text boxes and such, but won't let me enter anything or make a selection in a combo box. If I select "no" for data entry, it will display the first record in the table, but won't let me change which record I'm looking at. This is true for both the form and the subforms.



    My end goal is setting up the form and subforms to allow a user to enter new data, and to go back and view (and preferably edit if possible) the records that have already been added. I think I read somewhere that you can only set a form to do one or the other, not both, but I figured it was worth asking.

    I would also like to set up the form/subforms to automatically use data filled in on the other form/subforms, for example if someone chooses a customerID in one form, I'd like it to automatically use that customerID in the Orders form, or something along that line if possible.

    Any help is greatly appreciated! If any additional information is needed please let me know

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    When you set the DataEntry Property to YES, the form will *only* show NEW records. If you save the record it will no longer show in the form.

  3. #3
    ItsRoland is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    111
    Thats what I thought, but why won't it let me enter anything when data entry is set to YES? Could it have something to do with the primary key (set to autonumber in the tables) being a field in the forms? Is the autonumber property preventing me from adding anything new or is it unrelated to that?

    And why can't I view records other than the first when data entry is set to NO?

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    What is the Record Source of your form? Is it a table or query. If a query, are there more than on table involved? Can you open the query and make changes directly?

  5. #5
    ItsRoland is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    111
    All record sources of the forms/subforms in question are tables

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    Create queries of each table and use that as your record source for the form rather then directly to the table. It eliminates some issues with table locking.

  7. #7
    ItsRoland is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    111
    Okay so I managed to get the form/subforms to allow me enter new data. How do I tell the form/subforms to use the customerID that was set in another form/subform to reduce redundancy?

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    How did you manage to get the form/subforms to allow data? Did you use the query suggestion I gave you? As for the CustomerID question you will have to describe your forms a biy more.

  9. #9
    ItsRoland is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    111
    Tbh, it just started functioning properly while I was working on other stuff within the db. Maybe I was doing something wrong or I changed something without meaning to, who knows. But I'll definitely use your recommendation if I start to have issues down the road.

    As for the forms. The customerID/Order example I gave was just an example of concept, but it translates over all the same.

    I have 2 ID's that have relationships with other tables that are relevant here. AssetID and ScenarioID. The first thing a user will do is fill out the asset form, which will create a new AssetID. After they do this, I'd like all the other forms that need to reference the AssetID to automatically use the AssetID that was just created so that users don't have to keep typing it in. So when the user moves on to the next step, a subform called "exposures", that subform will already know which AssetID its working with. Same with ScenarioID, so on and so forth.

    I hope that covers what you were looking for and made sense. I apologize if this wasn't enough/not the information you were looking for. I very much appreciate your help so far.

  10. #10
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by RuralGuy View Post
    When you set the DataEntry Property to YES...If you save the record it will no longer show in the form.
    To be clear...any saved Records will show in the Form...until the next time the Form is opened.

    Linq ;0)>

  11. #11
    ItsRoland is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jun 2018
    Posts
    111
    Okay, update. I've solved one issue, but realized I'm still dealing with another. (unresolved issue at the bottom)

    I've managed to get what I was looking for via trial and error in regards to my form/subforms. All I had to do was set the text/combo boxes "OnChange" event to run vba code that would update the other related fields with the value they were given. In case anyone else is looking for this in the future, here's how I did this:

    Right click the object (in my case it was the "scenarioID" text box), click properties, go to the event tab, click where it says "OnChange", build event, code builder. The following is an example of how to code this:

    Code:
    Private Sub textbox1name_Change()
    
    Dim Val As String 
    
    Val = Me.textbox1name.Value
    
    Me.subform1name!textbox2name = Val
    
    Me.subform1name!textbox3name = Val
    
    
    End Sub
    textbox1name is the original textbox that your changing the properties of, textbox2name and textbox3name are the ones you want to be the same as textbox1name.
    If the objects you're trying to change are in the main form, and not a subform, then use:
    Code:
    Me.textbox2name.Value = Val
    Hope that helps someone.


    However, I just realized that while I can enter new records with the form/subforms, I'm still unable to change which record I'm looking at when data entry is set to "NO". I can only view the first record, and clicking on other options doesn't do anything. Would changing the sources from tables to queries be the answer to this, or is there something else going on?

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

Similar Threads

  1. Replies: 2
    Last Post: 03-07-2018, 04:38 PM
  2. Replies: 9
    Last Post: 03-01-2017, 10:00 AM
  3. Replies: 2
    Last Post: 12-11-2015, 02:55 PM
  4. Replies: 5
    Last Post: 08-12-2013, 12:53 AM
  5. Replies: 1
    Last Post: 05-17-2012, 05:02 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