A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

RunTime Error 3134



 
 
Thread Tools Display Modes
  #11  
Old May 17th, 2007, 11:55 AM posted to microsoft.public.access.forms
ajhome
external usenet poster
 
Posts: 39
Default RunTime Error 3134

Good Morning,

I tried to bind it to a number field, but it gives me an error stating that
"control can't be edited; it's bound to the expression..." How can I insert
the value as a text string based on the choice the user makes?

Thanks,
Aj

"John W. Vinson" wrote:

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]

  #12  
Old May 17th, 2007, 12:27 PM posted to microsoft.public.access.forms
ajhome
external usenet poster
 
Posts: 39
Default RunTime Error 3134

This is the code I am using (from "The Access Web" to return strings:
Sub ctlOption_AfterUpdate()
Select Case me!ctlOption
Case 1:
Msgbox "One was Selected"
Case 2:
Msgbox "Two was selected"

End Select
End sub

How do I insert one of those strings into the field, resignorterm in my
employee table?

Thanks,
Aj

"John W. Vinson" wrote:

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]

  #13  
Old May 17th, 2007, 12:39 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default RunTime Error 3134

Assuming resignorterm is a text field in the underlying recordset of the
form, try:

Sub ctlOption_AfterUpdate()
Select Case me!ctlOption
Case 1:
Me.resignorterm = "Text for option 1"
Case 2:
Me.resignorterm = "Text for option 2"
End Select
End sub



--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"ajhome" wrote in message
...
This is the code I am using (from "The Access Web" to return strings:
Sub ctlOption_AfterUpdate()
Select Case me!ctlOption
Case 1:
Msgbox "One was Selected"
Case 2:
Msgbox "Two was selected"

End Select
End sub

How do I insert one of those strings into the field, resignorterm in my
employee table?

Thanks,
Aj

"John W. Vinson" wrote:

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]



  #14  
Old May 17th, 2007, 03:49 PM posted to microsoft.public.access.forms
ajhome
external usenet poster
 
Posts: 39
Default RunTime Error 3134

Would someone please tell me what is wrong with this code:

CurrentDb.Execute "INSERT INTO tblMovement (EmpID, SupervisorID,
CurrentSupervisorID, CurrentADID, ADID, InsertDate, EffectiveDate, User) " & _
"VALUES (" & lstSelectEmp.Column(0) & ", " &
cboNewSupervisor.Column(0) & ", " & cboCurrentSupervisor.Column(0) & ", " &
cboCurrentSupervisor.Column(2) & ", " & cboNewSupervisor.Column(2) & ", " &
Format(txtInsertDate, "\#yyyy\-mm\-dd\#") & _
"," & Format(txtEffectiveDate, "\#yyyy\-mm\-dd\#") & ",
" & txtUser & ")"


I get an error message stating "too few parameters. Expected 1"
  #15  
Old May 17th, 2007, 04:25 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default RunTime Error 3134

You asked this yesterday in a thread called "Run Time Error (again!)", and I
answered you then. Please don't start new threads when the previous ones are
still active!

To save you the effort of looking for the answer I gave you yesterday, here
it is again:

RepeatAnswer

Is User a text field? If so, you need quotes around the value you're
inserting. As well, User is a bad choice for a field name: it's a reserved
word, and using reserved words for your own purposes can lead to problems.
If you cannot (or will not) change the name, at least put square brackets
around it.

CurrentDb.Execute "INSERT INTO tblMovement (EmpID, SupervisorID,
CurrentSupervisorID, CurrentADID, ADID, InsertDate, EffectiveDate, User) " &
_
"VALUES (" & lstSelectEmp.Column(0) & ", " & _
cboNewSupervisor.Column(0) & ", " & _
cboCurrentSupervisor.Column(0) & ", " & _
cboCurrentSupervisor.Column(2) & ", " & _
cboNewSupervisor.Column(2) & ", " & _
Format(txtInsertDate, "\#yyyy\-mm\-dd\#") & _
"," & Format(txtEffectiveDate, "\#yyyy\-mm\-dd\#") & _
", " & Chr$(34) & txtUser & Chr$(34) & ")"

(I'm assuming the ID fields are all numeric. If not, you'll need quotes
there too)

For a good discussion of what names to avoid, see what Allen Browne has at
http://www.allenbrowne.com/Ap****ueBadWord.html

/RepeatAnswer


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"ajhome" wrote in message
...
Would someone please tell me what is wrong with this code:

CurrentDb.Execute "INSERT INTO tblMovement (EmpID, SupervisorID,
CurrentSupervisorID, CurrentADID, ADID, InsertDate, EffectiveDate, User) "
& _
"VALUES (" & lstSelectEmp.Column(0) & ", " &
cboNewSupervisor.Column(0) & ", " & cboCurrentSupervisor.Column(0) & ", "
&
cboCurrentSupervisor.Column(2) & ", " & cboNewSupervisor.Column(2) & ", "
&
Format(txtInsertDate, "\#yyyy\-mm\-dd\#") & _
"," & Format(txtEffectiveDate, "\#yyyy\-mm\-dd\#") &
",
" & txtUser & ")"


I get an error message stating "too few parameters. Expected 1"



  #16  
Old May 17th, 2007, 04:37 PM posted to microsoft.public.access.forms
ajhome
external usenet poster
 
Posts: 39
Default RunTime Error 3134

Please forgive me. I completely forgot about that thread. Thank you for all
of your help.

Aj

"Douglas J. Steele" wrote:

You asked this yesterday in a thread called "Run Time Error (again!)", and I
answered you then. Please don't start new threads when the previous ones are
still active!

To save you the effort of looking for the answer I gave you yesterday, here
it is again:

RepeatAnswer

Is User a text field? If so, you need quotes around the value you're
inserting. As well, User is a bad choice for a field name: it's a reserved
word, and using reserved words for your own purposes can lead to problems.
If you cannot (or will not) change the name, at least put square brackets
around it.

CurrentDb.Execute "INSERT INTO tblMovement (EmpID, SupervisorID,
CurrentSupervisorID, CurrentADID, ADID, InsertDate, EffectiveDate, User) " &
_
"VALUES (" & lstSelectEmp.Column(0) & ", " & _
cboNewSupervisor.Column(0) & ", " & _
cboCurrentSupervisor.Column(0) & ", " & _
cboCurrentSupervisor.Column(2) & ", " & _
cboNewSupervisor.Column(2) & ", " & _
Format(txtInsertDate, "\#yyyy\-mm\-dd\#") & _
"," & Format(txtEffectiveDate, "\#yyyy\-mm\-dd\#") & _
", " & Chr$(34) & txtUser & Chr$(34) & ")"

(I'm assuming the ID fields are all numeric. If not, you'll need quotes
there too)

For a good discussion of what names to avoid, see what Allen Browne has at
http://www.allenbrowne.com/Ap****ueBadWord.html

/RepeatAnswer


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"ajhome" wrote in message
...
Would someone please tell me what is wrong with this code:

CurrentDb.Execute "INSERT INTO tblMovement (EmpID, SupervisorID,
CurrentSupervisorID, CurrentADID, ADID, InsertDate, EffectiveDate, User) "
& _
"VALUES (" & lstSelectEmp.Column(0) & ", " &
cboNewSupervisor.Column(0) & ", " & cboCurrentSupervisor.Column(0) & ", "
&
cboCurrentSupervisor.Column(2) & ", " & cboNewSupervisor.Column(2) & ", "
&
Format(txtInsertDate, "\#yyyy\-mm\-dd\#") & _
"," & Format(txtEffectiveDate, "\#yyyy\-mm\-dd\#") &
",
" & txtUser & ")"


I get an error message stating "too few parameters. Expected 1"




  #17  
Old May 29th, 2007, 03:13 PM posted to microsoft.public.access.forms
ajhome
external usenet poster
 
Posts: 39
Default RunTime Error 3134

Hello,
Would someone please tell me what is wrong with this code:
CurrentDb.Execute "INSERT INTO tblMovement (EmpID, InsertDate,
EffectiveDate, CurrentUser, NewSupervisor, NewTitle, NewCenter) " & _
"VALUES (" & lstSelectEmp.Column(0) & ", " & Format(txtInsertDate,
"\#yyyy\-mm\-dd\#") & _
"," & Format(txtEffectiveDate, "\#yyyy\-mm\-dd\#") & ", " & Chr$(34) &
txtCurrent & Chr$(34) & ", " & cboNewSupervisor & _
", " & cboNewTitle & ", " & cboNewCenter & ")"

The last 3 fields are text fields. When I put quotes around them, it gives
me an error message of too few fields.

Thanks,
AJ
  #18  
Old May 29th, 2007, 04:51 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default RunTime Error 3134

If they're text fields, you need quotes around them, just as you have for
the CurrentUser field.

CurrentDb.Execute "INSERT INTO tblMovement " & _
"(EmpID, InsertDate, EffectiveDate, CurrentUser, " & _
"NewSupervisor, NewTitle, NewCenter) " & _
"VALUES (" & lstSelectEmp.Column(0) & ", " & _
Format(txtInsertDate, "\#yyyy\-mm\-dd\#") & _
"," & Format(txtEffectiveDate, "\#yyyy\-mm\-dd\#") & ", " & _
Chr$(34) & txtCurrent & Chr$(34) & ", " & _
Chr$(34) & cboNewSupervisor & Chr$(34) & ", " & _
Chr$(34) & cboNewTitle & Chr$(34) & ", " & _
Chr$(34) & cboNewCenter & Chr$(34) & ")"


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"ajhome" wrote in message
...
Hello,
Would someone please tell me what is wrong with this code:
CurrentDb.Execute "INSERT INTO tblMovement (EmpID, InsertDate,
EffectiveDate, CurrentUser, NewSupervisor, NewTitle, NewCenter) " & _
"VALUES (" & lstSelectEmp.Column(0) & ", " & Format(txtInsertDate,
"\#yyyy\-mm\-dd\#") & _
"," & Format(txtEffectiveDate, "\#yyyy\-mm\-dd\#") & ", " & Chr$(34) &
txtCurrent & Chr$(34) & ", " & cboNewSupervisor & _
", " & cboNewTitle & ", " & cboNewCenter & ")"

The last 3 fields are text fields. When I put quotes around them, it
gives
me an error message of too few fields.

Thanks,
AJ



  #19  
Old May 29th, 2007, 05:05 PM posted to microsoft.public.access.forms
ajhome
external usenet poster
 
Posts: 39
Default RunTime Error 3134

Hello Douglas,

Thank you for your help. I have entered the code just as you have said.
However, it still doesn't work. I am not getting an error message, it just
doesn't do anything. It acts as if the button doesn't have any coding behind
it.

"Douglas J. Steele" wrote:

If they're text fields, you need quotes around them, just as you have for
the CurrentUser field.

CurrentDb.Execute "INSERT INTO tblMovement " & _
"(EmpID, InsertDate, EffectiveDate, CurrentUser, " & _
"NewSupervisor, NewTitle, NewCenter) " & _
"VALUES (" & lstSelectEmp.Column(0) & ", " & _
Format(txtInsertDate, "\#yyyy\-mm\-dd\#") & _
"," & Format(txtEffectiveDate, "\#yyyy\-mm\-dd\#") & ", " & _
Chr$(34) & txtCurrent & Chr$(34) & ", " & _
Chr$(34) & cboNewSupervisor & Chr$(34) & ", " & _
Chr$(34) & cboNewTitle & Chr$(34) & ", " & _
Chr$(34) & cboNewCenter & Chr$(34) & ")"


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"ajhome" wrote in message
...
Hello,
Would someone please tell me what is wrong with this code:
CurrentDb.Execute "INSERT INTO tblMovement (EmpID, InsertDate,
EffectiveDate, CurrentUser, NewSupervisor, NewTitle, NewCenter) " & _
"VALUES (" & lstSelectEmp.Column(0) & ", " & Format(txtInsertDate,
"\#yyyy\-mm\-dd\#") & _
"," & Format(txtEffectiveDate, "\#yyyy\-mm\-dd\#") & ", " & Chr$(34) &
txtCurrent & Chr$(34) & ", " & cboNewSupervisor & _
", " & cboNewTitle & ", " & cboNewCenter & ")"

The last 3 fields are text fields. When I put quotes around them, it
gives
me an error message of too few fields.

Thanks,
AJ




  #20  
Old May 29th, 2007, 05:25 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default RunTime Error 3134

Is the code executing? If you look at the On Click property of the form,
does it say [Event Procedure]? If not, correct that. If it does, try putting
a breakpoint in your code to see whether it runs (or a message box)

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"ajhome" wrote in message
...
Hello Douglas,

Thank you for your help. I have entered the code just as you have said.
However, it still doesn't work. I am not getting an error message, it
just
doesn't do anything. It acts as if the button doesn't have any coding
behind
it.

"Douglas J. Steele" wrote:

If they're text fields, you need quotes around them, just as you have for
the CurrentUser field.

CurrentDb.Execute "INSERT INTO tblMovement " & _
"(EmpID, InsertDate, EffectiveDate, CurrentUser, " & _
"NewSupervisor, NewTitle, NewCenter) " & _
"VALUES (" & lstSelectEmp.Column(0) & ", " & _
Format(txtInsertDate, "\#yyyy\-mm\-dd\#") & _
"," & Format(txtEffectiveDate, "\#yyyy\-mm\-dd\#") & ", " & _
Chr$(34) & txtCurrent & Chr$(34) & ", " & _
Chr$(34) & cboNewSupervisor & Chr$(34) & ", " & _
Chr$(34) & cboNewTitle & Chr$(34) & ", " & _
Chr$(34) & cboNewCenter & Chr$(34) & ")"


--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"ajhome" wrote in message
...
Hello,
Would someone please tell me what is wrong with this code:
CurrentDb.Execute "INSERT INTO tblMovement (EmpID, InsertDate,
EffectiveDate, CurrentUser, NewSupervisor, NewTitle, NewCenter) " & _
"VALUES (" & lstSelectEmp.Column(0) & ", " & Format(txtInsertDate,
"\#yyyy\-mm\-dd\#") & _
"," & Format(txtEffectiveDate, "\#yyyy\-mm\-dd\#") & ", " & Chr$(34)
&
txtCurrent & Chr$(34) & ", " & cboNewSupervisor & _
", " & cboNewTitle & ", " & cboNewCenter & ")"

The last 3 fields are text fields. When I put quotes around them, it
gives
me an error message of too few fields.

Thanks,
AJ






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:42 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.