Multiple assignment of selected record

J

Jologs

Hi:

I have a Form (bounds to a junction table) which has txtbox1 and txtbox2.
Attached is a subform which has a txtbox1sub (related to txtbox1 of the Main
Form) txtbox2sub , txtboxA and txtboxB. I have a command button in the Main
Form that assign value(SETVALUE) to txtbox2 which is equivalent to value of
txtbox2sub. Assigning single data was not a problem. Now, I changed the
subform to a continues form so that user can select more than 1 record at a
time and that when the user click the button, the multiple selected records
will be assinged to the record in the Main Form. How will I do this? I'm
stuck.
 
M

MacDermott

I do hope you're not trying to store multiple values in a single field in a
single record, but instead want to create multiple records. What else will
be in these records?

For starters, I'd suggest you consider a multi-select listbox instead of a
subform; it's much easier to extract the selected items. If you look at
help on multi-select listboxes, you may find some code which will point you
towards your solution; if you have specific questions, please post back.
 
J

Jologs

Hi:

What I'm trying to do is to create multiple records when multiple records
are selected from another form. I've thought of the listbox and tried it, but
my problem is I don't know how to create the code to create multiple records
in the table when multiple records are selected (in a Form). I can't even
execute the multiple records selected in the listbox.

My scenario is this. I have a tblTask that contains strCategory, strTask,
strDate and strStaff. I created another Table, tblStaff which serves as
lookup values for the strStaff. What I want is when multiple records are
selected in the listbox of frmStaff(tblStaff) , it will create a multiple
records for tblTask.

That is way I resorted to create a one to many relationship for the tblTask
and tblStaff. But, my problem is I have another table that relate to tblTask.
I guess creating a listbox is easier. Hope you can help me. Thank you very
much.
 
M

MacDermott

It might help to know a little bit more about the structure of your data.
What is the primary key of tblTask?
Does each task always belong to the same category?
e.g. the task "balance checkbook" always belongs under the category
"finance"
Or can some tasks belong to several different categories?
e.g. the task "clean-up" might belong to "cook dinner" or "fix car".

The reason I'm asking these questions is that I'm afraid that your data
structure may not be appropriately normalized.
It's important to work out all your table designs before you go very far
into building forms and coding operations.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top