473,289 Members | 1,953 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,289 software developers and data experts.

Can someone tell me why this insert query is not working

1
I have this simple query:
Expand|Select|Wrap|Line Numbers
  1. strSQL = "INSERT INTO tblEngParRole (Eng_ID, Person_ID, ParticipantNumber, Role)" & "VALUES(" & Me.Eng_ID & "," & .ItemData(n) & "," & 1 & "," & '" & Me.txtParRole1 & "' & ")"
What I am expecting to be inserted into the Role field in the table is the information typed into the text box, but what I am getting is Me.txtParRole1 instead. I can't figure out why this is.

Thanks,

Bruce
Jan 31 '23 #1
1 4423
NeoPa
32,554 Expert Mod 16PB
Hi Bruce.

Welcome to Bytes.com.

You've posted a line of VBA code that possibly creates something in the form of SQL that relies on various items you haven't introduced or explained. You don't even show how you execute the resultant string. You nevertheless want us to debug this for you?

I suggest you check out How to Debug SQL String and then provide us with something we can work with more reasonably.
Feb 1 '23 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: avinash | last post by:
hello myself avinash i am developing on application having vb 6 as front end and sql server 7 as back end. when i use insert query to insert data in table then the date value of that query is...
8
by: Carl | last post by:
Hi, I hope someone can share some of their professional advice and help me out with my embarissing problem concerning an Access INSERT query. I have never attempted to create a table with...
5
by: Annie | last post by:
hello guys, I have little experience working with C# and MS Access ... I am having an insert query with one datetime field and a boolean and couple of text and number fields as below: ...
2
by: Just Me | last post by:
Dim iData As IDataObject = Clipboard.GetDataObject() Dim img As System.Drawing.Bitmap img = img.FromFile(ofd.FileName, True) Clipboard.SetDataObject(img) TextControl1.Paste() img.Dispose() : img...
0
by: clickon | last post by:
I want to use an INSERT Query as the value for the UpdateCommand property of an SQL datasource, anyone know if this will actually work ? The reason i want to do it is bacause i am taking values...
2
candicemc
by: candicemc | last post by:
Can anyone help me please?! I am a beginner and i am in desperate need of help. I have to create an insert query in access using a table i've already created called "madlibs" Then I have to create...
1
by: rubinamunir | last post by:
Hi. i need help in insert query . i am working in php and oracle there i need insert datetime.i don't know the format please tell me how can i insert date with time in oracle and wht must...
1
by: billypit | last post by:
Hi, In my project i have one table production.Now i have to make application in which i have to insert new data in table by fields of form made in access.I don't know how to use form field's values...
2
by: aaron1234nz | last post by:
I am trying to insert new rows into a table but there are a few tricky things I have not been able to get my head around. 1. I need to insert a unique ID in each row. 2. I need to insert rows...
6
by: npdv2009 | last post by:
My php script performs a insert query , Then i want it to go to another html page. header('Location : <url>') not working. I an working on wamp server.
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
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...
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)...

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.