AccessWillKill
Registered User.
- Local time
- Today, 02:54
- Joined
- Oct 2, 2010
- Messages
- 50
I've been given a theory to work with over this weekend in office 2003
i have a form with alot of fields. Its been a pain. its crashed the form etc etc
basically all the field names in the form are the same as the table and what i was wondering if rather than having them all in a massive SQL string that would update the table with the relevent field information (three fields get inserted into the table on form load), is it possible to create a loop using an array to update the table, field by field, using the array like so:
sqlstr = Update tablename (tablename.fieldnamefromarray1 = formname.fieldnamefromarray1 ) Where (tablename.pkfield = formnamepkfield.value)
So basically where it says fieldnamefromarray1 the sql string would utilise the names from the array rather than taking the field names from the form and table (which would be the same names the array holds anyway) to insert into the table.
i'm not sure the sql string would like it too much but its not something i've ever attempted until this weekend.
A) is it possible
B) could i get some help with this as i go along
i have a form with alot of fields. Its been a pain. its crashed the form etc etc
basically all the field names in the form are the same as the table and what i was wondering if rather than having them all in a massive SQL string that would update the table with the relevent field information (three fields get inserted into the table on form load), is it possible to create a loop using an array to update the table, field by field, using the array like so:
sqlstr = Update tablename (tablename.fieldnamefromarray1 = formname.fieldnamefromarray1 ) Where (tablename.pkfield = formnamepkfield.value)
So basically where it says fieldnamefromarray1 the sql string would utilise the names from the array rather than taking the field names from the form and table (which would be the same names the array holds anyway) to insert into the table.
i'm not sure the sql string would like it too much but its not something i've ever attempted until this weekend.
A) is it possible
B) could i get some help with this as i go along