subform for new record additon (1 Viewer)

NT100

Registered User.
Local time
Tomorrow, 01:13
Joined
Jul 29, 2017
Messages
148
Hi, I've a main form in which a listbox is created for the keys of electronic payment cards (e.g. Unique key: 1, 2, 3....). Once the particular key (e.g 2) is selected from the listbox. I expect that a subform is available for adding new transactions for that key (e.g. 2).

Since subform can be made a datasheet style, it allows multiple entries of new entries (e.g. 10 records) . Is it possible to make it up in this way and save the added records to a table?

Thank you any suggestions?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:13
Joined
Oct 29, 2018
Messages
21,358
Hi. It sounds like you basically want to set the Default Value for the "key" in the subform. You can do this in two ways, you can use code in the AfterUpdate event of the Listbox to set the Default Value of the subform, or you could link the subform to the Listbox, and Access will automatically fill in the matching key for you.
 

NT100

Registered User.
Local time
Tomorrow, 01:13
Joined
Jul 29, 2017
Messages
148
Hi. It sounds like you basically want to set the Default Value for the "key" in the subform. You can do this in two ways, you can use code in the AfterUpdate event of the Listbox to set the Default Value of the subform, or you could link the subform to the Listbox, and Access will automatically fill in the matching key for you.

Have any samples to do the key and the addition of records?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:13
Joined
Oct 29, 2018
Messages
21,358
Have any samples to do the key and the addition of records?
To set the default value, you could try something like:
Code:
Me.ControlName.DefaultValue = """" & Me.OtherControlName & """"
Hope it helps...
 

NT100

Registered User.
Local time
Tomorrow, 01:13
Joined
Jul 29, 2017
Messages
148
To set the default value, you could try something like:
Code:
Me.ControlName.DefaultValue = """" & Me.OtherControlName & """"
Hope it helps...

I have no idea of doing the new records in the subform and then save it for the selected Octopus card.

I have built an applications. I need to enter expense transactions into a subform (datasheet style) of frmExpense. I prefer to write scripts to save the the new records in subform of frmExpense to tblExpense.

Pls. download and run to see if my requirement can be done.

Thank you.
 

Attachments

  • OCSystem.zip
    187.2 KB · Views: 47

theDBguy

I’m here to help
Staff member
Local time
Today, 10:13
Joined
Oct 29, 2018
Messages
21,358
I have no idea of doing the new records in the subform and then save it for the selected Octopus card.

I have built an applications. I need to enter expense transactions into a subform (datasheet style) of frmExpense. I prefer to write scripts to save the the new records in subform of frmExpense to tblExpense.

Pls. download and run to see if my requirement can be done.

Thank you.
Hi. Okay, I downloaded your database and opened it. I see three buttons. What do I do next? Looking at all your forms, I see none of them is bound to a record source. If you want to enter multiple records in the subform, you'll have to bind it to a table, it could be a temporary one, if you prefer to use code later on to put those records into the actual table.
 

NT100

Registered User.
Local time
Tomorrow, 01:13
Joined
Jul 29, 2017
Messages
148
Hi. Okay, I downloaded your database and opened it. I see three buttons. What do I do next? Looking at all your forms, I see none of them is bound to a record source. If you want to enter multiple records in the subform, you'll have to bind it to a table, it could be a temporary one, if you prefer to use code later on to put those records into the actual table.

Thank you for the suggestions.
Let me try a temporary table for new records and a follow up operations to put those records into an actual table.

Thank you.
 

Users who are viewing this thread

Top Bottom