By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

how to insert multible values by making one selection from combo box in forms

P: n/a
how to insert multible values by making one selection from combo box in
forms. any way to code insert SQL in froms??

Apr 21 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Can you give us an example of what you're trying to accomplish? Your
post is a tad vague.

Jana

Apr 21 '06 #2

P: n/a
thanks, but i figure out by coding "INSERT INTO" mutibule values when
there is change of selection.

but i have another question, i am very new to access, how can i write i
simple macro function that detect if the data exits, then any changes
should use update sql instead of insert sql, vice versa.

Apr 21 '06 #3

P: n/a
a simple sudu code would be like this ,

like sudu code:

var_1 = run sql "select level_id from knowledge where contactid = 1 and
skillid = 2"

if not null(var_1) { run sql "update knowledge set level_id = level_id
where contactid = 1 and skillid = 2" }

else run sql "insert knowledge (contactid, skillid, Level_id) value
(contactid, skillid, level_id) }

end

any help, many thanks

Apr 21 '06 #4

P: n/a
Try this **aircode**:
var_1 = DLookup("level_id","knowledge","contact_id = 1 and skill_id =
2)
If Not IsNull(var_1) then
DoCmd.RunSQL "update knowledge set level_id = level_id where
contactid = 1 and skillid = 2"
Else
DoCmd.RunSQL "insert into knowledge (contactid, skillid, Level_id)
values (contactid, skillid, level_id)"
End If

Note: If you are getting the values from your open form for your
insert SQL, it will change like this (all one line):
DoCmd.RunSQL "insert into knowledge (contactid, skillid, Level_id)
values (" & Me!contactid & "," & Me!skillid & "," & Me!level_id & ")"

HTH,
Jana

Apr 21 '06 #5

P: n/a
THANK YOU SO MUCH!!!!, life savior!!!! :D

Apr 21 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.