RE: VBA Code Help
- From: Ofer Cohen <OferCohen@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 23 Apr 2007 09:04:02 -0700
I did in the last post
--
Good Luck
BS"D
"alfiajamel" wrote:
You have been so much help thus far, however, I am just not getting it right!.
Would you be willing to type the code out for me?
"Ofer Cohen" wrote:
Try
Would someone please tell me what I am doing wrong?!!??!? I have tried the
quotes and I am still getting a compile error. Both ID fields are text. My
coding is below (at least my attempt at coding):
CurrentDb.Execute "DELETE FROM tblMovement " & _
" WHERE EmpId = '" & lstNewSupervisor.Column(0) & _
"' AND SupervisorID = '" & txtSupervisorID & "'"
**** In the last line you have double quote to much in the beggining, and
missing an & in the end to include the last single quote, and I assume by
your code that both fields SupervisorID and EmpId are text fields, if they
not you'll get a type mismatch, in that case remove the single quote
--
Good Luck
BS"D
"alfiajamel" wrote:
Greetings...
Would someone please tell me what I am doing wrong?!!??!? I have tried the
quotes and I am still getting a compile error. Both ID fields are text. My
coding is below (at least my attempt at coding):
CurrentDb.Execute "DELETE FROM tblMovement " & _
"WHERE EmpId = '" & lstNewSupervisor.Column(0) & _
"'" AND SupervisorID = '" & txtSupervisorID "'"
"Ofer Cohen" wrote:
Make sure that the txtSupervisorID and lstNewSupervisor.Column(0) return value.
CurrentDb.Execute "DELETE FROM tblMovement " & _
"WHERE EmpId = '" & lstNewSupervisor.Column(0) & _
"' AND SupervisorID = " & txtSupervisorID
If txtSupervisorID field will be blank you'll get syntax error
--
Good Luck
BS"D
"alfiajamel" wrote:
Greetings...
I am getting a complie syntex error with the code listed below! Can someone
please help me with it? The ID Fields are text fields.
CurrentDb.Execute "DELETE FROM tblMovement " & _
"WHERE EmpId = '" & lstNewSupervisor.Column(0) & _
"' AND SupervisorID = " & txtSupervisorID
Thanks!
- References:
- RE: VBA Code Help
- From: Ofer Cohen
- RE: VBA Code Help
- From: alfiajamel
- RE: VBA Code Help
- Prev by Date: Create a Constants table in VB code
- Next by Date: Re: Put a form from another database as a subform
- Previous by thread: RE: VBA Code Help
- Next by thread: Re: DLookup refresh help needed.
- Index(es):
Relevant Pages
|