Unbound Sub-Form (1 Viewer)

sacacompany

New member
Local time
Today, 09:37
Joined
Dec 28, 2022
Messages
28
can i make multiple entries in sub form which is unbound...how?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 12:37
Joined
May 7, 2009
Messages
19,247
i don't think so.
you can try a disconnect ADO.recordset if you need.
but on second thought, nobody uses Unbound form with multiple entries.
 

sacacompany

New member
Local time
Today, 09:37
Joined
Dec 28, 2022
Messages
28
what is the best way to get multiple entries in a form and save all to sql sever table. Its a sub form of a main form and both are unbound
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 12:37
Joined
May 7, 2009
Messages
19,247
if the intension is to Save New Records, you can use ADO.Recordset or Arrays.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 12:37
Joined
May 7, 2009
Messages
19,247
sample ADODB.Recordset (standalone).
to push to SQL server, you just identify which records has both FirstName + LastName that are not null and only save those.
 

Attachments

  • UnboundMainForm.accdb
    768 KB · Views: 27

ebs17

Well-known member
Local time
Today, 06:37
Joined
Feb 7, 2020
Messages
1,949
Why do you emphasize that the forms are unbound?

With a bound form, you basically write directly into the table. This is intellectually easy.

With an unbound form, you have to use your own actions (action queries, recordsets) to ensure that your recorded data gets into the desired table.

You should master both. Which is better also depends on the environment to be implemented.
 
Last edited:

jdraw

Super Moderator
Staff member
Local time
Today, 00:37
Joined
Jan 23, 2006
Messages
15,379
sacacompany,

Can you describe what you are trying to accomplish? Perhaps an example showing before and after.
Then readers can offer some options on how it can/could be achieved.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 00:37
Joined
Feb 19, 2002
Messages
43,302
what is the best way to get multiple entries in a form and save all to sql sever table. Its a sub form of a main form and both are unbound
Don't use Access.

What is your aversion to a bound form? Bound forms are why people actually use Access. There are lots "better" development platforms if you don't want to take advantage of the best features of Access.
 

sacacompany

New member
Local time
Today, 09:37
Joined
Dec 28, 2022
Messages
28
Actually i have a master and detail table of receipts from customers. i m trying to capture receipts master data on form and add a sub form to capture detail records of receipts. both my form are un bound and i m using sql server db as backend and use connection and insert/update etc queries in vba to perform CRUD.
But now i figured out that unbound subforms are not the option.
Now i m trying to find out the best available work around to capture master child entries on a form and insert them in tables..thks in advance
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 00:37
Joined
May 21, 2018
Messages
8,536
Use a temp tables. I do not get the issue.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 00:37
Joined
Feb 19, 2002
Messages
43,302
What work-around? Just bind the forms.

Remove ALL your code that doesn't relate to validation. Move the validation code to the form's beforeUpdate event. Add the -
Cancel = True command in the places where you find a validation error. Let Access manage everything elxe.
 

Users who are viewing this thread

Top Bottom