If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
RunTime Error 3134
Greetings...
Could someone tell me what is wrong with this line of code? CurrentDb.Execute "INSERT INTO tblExistCheckList (EmpID, SupervisorID, ADID,)" & _ "VALUES (" & lstSelectEmp.Column(0) & ", " & lstSelectEmp.Column(2) & ", " & lstSelectEmp.Column(4) & ")" All of the ID fields are text fields. |
#2
|
|||
|
|||
RunTime Error 3134
OK! Nevermind! I figured out I had an extra comma. However, I still need
help. I have a form that is populating a table. The code below is suppose to add those 3 fields and the others in on the form. However, it is adding the 3 fields from the code as a new record instead of with the other fields on the form. Any suggestions? Thanks, AJ |
#3
|
|||
|
|||
RunTime Error 3134
You've got a comma between ADID and the closing parenthesis. As well, since
the ID fields are text, you must put quotes around the values: CurrentDb.Execute "INSERT INTO tblExistCheckList (EmpID, SupervisorID, ADID) " & _ "VALUES ('" & lstSelectEmp.Column(0) & "', '" & lstSelectEmp.Column(2) & "', '" & lstSelectEmp.Column(4) & "')" Exagerated for clarity, that's CurrentDb.Execute "INSERT INTO tblExistCheckList (EmpID, SupervisorID, ADID) " & _ "VALUES ( ' " & lstSelectEmp.Column(0) & " ' , ' " & lstSelectEmp.Column(2) & " ', ' " & lstSelectEmp.Column(4) & " ' )" (apologies in advance for the line wrapping.) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "ajhome" wrote in message ... Greetings... Could someone tell me what is wrong with this line of code? CurrentDb.Execute "INSERT INTO tblExistCheckList (EmpID, SupervisorID, ADID,)" & _ "VALUES (" & lstSelectEmp.Column(0) & ", " & lstSelectEmp.Column(2) & ", " & lstSelectEmp.Column(4) & ")" All of the ID fields are text fields. |
#4
|
|||
|
|||
RunTime Error 3134
Thanks! Maybe you could help me with my other problem! I have an unbound
form with a bound subform. When I try to insert fields into the current record of the subform, it adds the fields as new records instead of the current. How do I insert data into the current record? Thanks, AJ |
#5
|
|||
|
|||
RunTime Error 3134
Realistically, it makes no sense to have a bound subform and an unbound
form. Subforms must be linked to the parent form, and you can't link unbound forms. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "ajhome" wrote in message ... Thanks! Maybe you could help me with my other problem! I have an unbound form with a bound subform. When I try to insert fields into the current record of the subform, it adds the fields as new records instead of the current. How do I insert data into the current record? Thanks, AJ |
#6
|
|||
|
|||
RunTime Error 3134
On Thu, 10 May 2007 16:27:46 -0400, "Douglas J. Steele"
wrote: Realistically, it makes no sense to have a bound subform and an unbound form. Subforms must be linked to the parent form, and you can't link unbound forms. Well, I hate to disagree Douglas, but this is actually a pretty handy technique for lots of things. You CAN link a bound subform to a control in an unbound mainform; you need to use the *control name* - not a fieldname - as the Master Link field. It can be a handy way to give a quick filtered form. John W. Vinson [MVP] |
#7
|
|||
|
|||
RunTime Error 3134
Thank you both for your input! As part of the same form, I have an option
group (check boxes.) How do I insert whatever value my user selects into my table? Thanks, AJ "John W. Vinson" wrote: On Thu, 10 May 2007 16:27:46 -0400, "Douglas J. Steele" wrote: Realistically, it makes no sense to have a bound subform and an unbound form. Subforms must be linked to the parent form, and you can't link unbound forms. Well, I hate to disagree Douglas, but this is actually a pretty handy technique for lots of things. You CAN link a bound subform to a control in an unbound mainform; you need to use the *control name* - not a fieldname - as the Master Link field. It can be a handy way to give a quick filtered form. John W. Vinson [MVP] |
#8
|
|||
|
|||
RunTime Error 3134
On Fri, 11 May 2007 04:29:01 -0700, ajhome
wrote: Thank you both for your input! As part of the same form, I have an option group (check boxes.) How do I insert whatever value my user selects into my table? An Option Group control has a single numeric value indicating which choice the user made. What do you want inserted in your table? That number? A text string based on the choice? or what? John W. Vinson [MVP] |
#9
|
|||
|
|||
RunTime Error 3134
Good Morning,
I want to be able to insert the number or a text string based on the choice made. Thanks, Alfia "John W. Vinson" wrote: On Fri, 11 May 2007 04:29:01 -0700, ajhome wrote: Thank you both for your input! As part of the same form, I have an option group (check boxes.) How do I insert whatever value my user selects into my table? An Option Group control has a single numeric value indicating which choice the user made. What do you want inserted in your table? That number? A text string based on the choice? or what? John W. Vinson [MVP] |
#10
|
|||
|
|||
RunTime Error 3134
On Mon, 14 May 2007 04:42:01 -0700, ajhome
wrote: Good Morning, I want to be able to insert the number or a text string based on the choice made. Well... WHICH? Where do you want to insert it? If you bind the option Group control to a number field, it will store the selected number. John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|