• ** There has been a recent site upgrade. Please clear your browser cache to avoid issues. **
  • New forum feature - post voting and best solution

    Check out this thread for the details: https://www.access-programmers.co.uk/forums/threads/new-forum-feature-post-voting-and-best-answer.314134/

    This new feature looks great to me! :)

  • We now have 3 forum themes

    Go for the default (light) theme, Shades of Grey or Shades of Blue. I just added the Blue one.

    The thread about it is here: https://www.access-programmers.co.uk/forums/threads/new-forum-theme-shades-of-blue.314136/

Repeating Form Fields (1 Viewer)

B

Beatha Galloway

Guest
I have a database that I've just about completed. There are forms that are attached to a main form by command buttons. These buttons opens each form and allows the end-user to enter data. While on the main form the 2 identifiers that distinguishes one record from the other are the facility id (primary key) and the hotel name fields.

When the end user chooses to go to any of the other forms, the facility id and hotel name should automatically be entered (locked) to distinguish that the end-user is still on the same hotel's record entry. If I set the field expression to read these fields, the information is not entered or locked into the field. Therefore, when I go into the table where the information should be, there is only the information that was entered and the 2 fields that I need to carry over are blank. Because the facility id is a primary key, the program is not allowing the end-user to enter this information again, not to mention that this defeats the purpose of having a handy database like access.

In a nut shell I need the program to remember and write the information in these 2 fields from one form to another, and I can't get it to successfully do that. Can you help, please?????
 

Travis

Registered User.
Local time
Yesterday, 17:25
Joined
Dec 17, 1999
Messages
1,332
If I understand you correctly basically you want the two pieces of Information to come forward from you main form to you now open data entry forms.

If this is the case then try this. Don't set the fields to equal the fields on the main form instead bind them to there appropriate field on the Popup data entry form.

Then on the On_Current Event of the Popup Form add this code:

Private Sub Form_Current()
Me.HotelName = Forms!frmMain.HotelName
Me.FacilityID = Forms!frmMain.FacilityID
End Sub

I suggest putting the code on the Current Event only because I'm not sure if you are going to allow your users to add multiple records to the Popup at any given time (one to many relation). If they can only add one record (one to one relation) then I would suggest placing the code on the Form_Load Event.

Hope this helps.
 

Users who are viewing this thread

Top Bottom