473,327 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

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

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
5 1396
Can you give us an example of what you're trying to accomplish? Your
post is a tad vague.

Jana

Apr 21 '06 #2
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
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
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
THANK YOU SO MUCH!!!!, life savior!!!! :D

Apr 21 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bill | last post by:
I'm having what seems to me to be an odd problem. Perhaps there is some explanation, but don't know at this point. Basically I have a form that tracks memberships and donations. The main form...
2
by: Ausclad | last post by:
Hi, I have a combo box that I want to populate, based on the selection of another combo box. So when combo box A is selected, combo box B is populated with related values. I have this all...
8
by: ShyGuy | last post by:
I have two combo boxes that get their values from two different tables. I want to limit the choices in the second combo box by what is selected in the first. I tried using SelText (code...
1
by: The.Daryl.Lu | last post by:
Hi, two parts to my problem if someone can help address either one or both: 1. I want to SELECT everything in the table if it matches the criteria when the query button is pressed (this is just...
1
by: OllyJ | last post by:
Hi guys, probably an easy one for you. I know how to limit a row source sor a combo on a form (setting unique values). The problem i'm having is that the query is the record source for a...
2
by: Mtek | last post by:
Hi, We have a combo box on our page, which gets populated via a MySQL Query. What we want to do is to print the values on the page in a table that correspond the to selection from the combo...
4
by: Mtek | last post by:
Hi, We have a combo box on our page, which gets populated via a MySQL Query in PHP. What we want to do is to print the values on the page in a table that correspond the to selection from the...
2
by: lenygold via DBMonster.com | last post by:
Hi Everebody: I have a table: CREATE TABLE CROSS_REFERENCE (ROW# INTEGER NOT NULL ,KEY_WORD CHAR(16) NOT NULL ,QUERY_DESCR VARCHAR(330) NOT NULL ,PRIMARY KEY (ROW#,KEY_WORD)); It is a...
1
by: StuartD | last post by:
I have a sub form that is populated based on the selection of a year from a combo box on the main form. I'm trying to add a second main form combo box for item category to further filter the sub...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.