how to insert multible values by making one selection from combo box in
forms. any way to code insert SQL in froms?? 5 1396
Can you give us an example of what you're trying to accomplish? Your
post is a tad vague.
Jana
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.
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
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
THANK YOU SO MUCH!!!!, life savior!!!! :D This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
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...
|
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...
|
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...
|
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...
|
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)...
|
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....
|
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
| |