Using unbound forms and updating and creating new records ? (1 Viewer)

Db-why-not

Registered User.
Local time
Today, 09:16
Joined
Sep 17, 2019
Messages
159
I have a main form that will open up with several bound fields (patient Id, dateUpdated), from a table. Then there are 2 subforms on this main form that will be unbound and will be used for data entry that is related to the bound fields. The data entered in the unbound fields will go into 2 separate related tables. Can I use the same main form, and subforms to create new records and update already existing records? I will have a list of patients from a different form and user will click on the patient number and it will browseto this form with the patientid they clicked on for data entry form with some other fields of data already pre entered. Then on the subforms the user will enter in data and hit a submit button to save the records to the appropriate tables.

Can I use the same unbound forms to Create records, view records that have already been created and then edit also? I want to do multiple things with my unbound forms. Just wondering if its possible and if its a good idea to do it that way. Should I make separate unbound forms for editing old records and separate unbound forms for creating new records. Thanks.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:16
Joined
Oct 29, 2018
Messages
14,140
Hi. Since the subforms are unbound, you can make them do almost anything you want, using VBA. If you post a screenshot, we can tell more..
 

isladogs

CID VIP
Local time
Today, 15:16
Joined
Jan 14, 2017
Messages
14,441
Whilst you can do almost anything with unbound forms, it will take much more work for little benefit than doing the same tasks with bound forms which can also
Create records, view records that have already been created and then edit also
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 10:16
Joined
May 21, 2018
Messages
4,520
Can you explain why you have to use unbound forms? Not to be mean, but if you are asking such basic questions about unbound forms, you likely do not have the skill set to build or implement them. Unbound forms are a niche concept when you want to do something that just cannot be done with bound forms. Using them when a bound form will work is a complete waste of time. Further unlike other applications, Access was not designed for unbound forms so there are not the controls or tools to implement this easily. For example a simple unbound data grid does not exist. I concur with Isladogs, you are creating a lot of unnecessary work for no gain.
 

Db-why-not

Registered User.
Local time
Today, 09:16
Joined
Sep 17, 2019
Messages
159
list.JPG
data entry form.JPG


I attached a copy of my forms. I already made a version of these forms that are bound to the tables and it works. The reason I wanted to make them unbound is to prevent accidental data entry or incomplete data entry.
 

Db-why-not

Registered User.
Local time
Today, 09:16
Joined
Sep 17, 2019
Messages
159
I made it so Audit complete button can only be selected if all the fields have been answered. Then if audit completed is checked then that record is removed from pending audit list and moved to a completed audit list. If a user just navigates off of the form though and enters in partial information it will still be saved.
 

Db-why-not

Registered User.
Local time
Today, 09:16
Joined
Sep 17, 2019
Messages
159
I don't want to have to create a record in my 2 subform tables until someone is ready to create a record in those tables. If the linked record isnt already created in my linked subform tables then I get an error message. My subforms should be linked all by lpersonID field. It is setting the lpersonID on one of my subforms, but the deeper subform its not passing the lpersonID to it, then giving me that error message.
 

Attachments

  • error.JPG
    error.JPG
    109.5 KB · Views: 22

Db-why-not

Registered User.
Local time
Today, 09:16
Joined
Sep 17, 2019
Messages
159
I think I might just combine my two subform tables, then it should work. I dont think I really needed to have that data in 2 separate tables. I'm going to try that.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 10:16
Joined
May 21, 2018
Messages
4,520
The reason I wanted to make them unbound is to prevent accidental data entry or incomplete data entry.
For sure that can be done bound, just as easy or easier in bound forms. Incomplete and accidental data entry is done in the forms before update event. There are tons of threads on this. Not sure why you think you need unbound to do that.

I have been using a version of @arnelgp solutuion posted here and works very well.
 
Last edited:

Minty

AWF VIP
Local time
Today, 15:16
Joined
Jul 26, 2013
Messages
8,040
I'm in agreement with the others - the Forms BeforeUpdate event can capture all the fields and data requirements.

I'm not sure if it is just the way you explained it but this concerned me;
I made it so Audit complete button can only be selected if all the fields have been answered. Then if audit completed is checked then that record is removed from pending audit list and moved to a completed audit list.
Do you actually "move" the record from one table to another or simply have a flag or AuditCompletedDate field that indicates the audit was done?

You could set an AuditCompleted date based on successful validation, which would make it disappear or appear in your desired list.
 

Db-why-not

Registered User.
Local time
Today, 09:16
Joined
Sep 17, 2019
Messages
159
I guess I will just leave the forms bound. That is mainly how I have done most of my forms before. I just have a little experience with unbound forms.
 

Users who are viewing this thread

Top Bottom