list separator or )

  • Thread starter Thread starter Mr.Kane
  • Start date Start date
M

Mr.Kane

I am creating a login form and keep running into the same compile
error: "Expected: List separator or )"

Here is the offending code segment:
If Me.Login_PW = DLookup("Staff_Password", "Staff", "[Staff_ID]='"
&Me.LogIn_ID& ""')Then
Staff_Name = Me.LogIn_ID.Value


The highlighted segment of code are the 2 double quotes after
&Me.LogIn_ID&


I'm sure the correct syntax will be obvious after the fact but it's
incredibly frustrating right now.


any help would be appreciated
I am willing to send anyone who can help a screenshot of the error for
your evaluation. I believe
that I have the order correct but it may help you to see the error and
the highlighted code segment.

Thank you,
Marc
 
Hi Mr.Kane,

If login_ID is a number, you do not need the extra quotes at all... If it
is a string, try using a single quote like this:

DLookup("Staff_Password", "Staff", "[Staff_ID]='" & Me.LogIn_ID & "'")

You might also want to consider checking for null in case you have no
matching Staff in the table with the entered Staff_ID. Also, just to prevent
confusion, if you are calling it Staff_ID in the table, why not call it
Staff_ID on your form also for consistency.

Hope this helps.

Damian.


where after the equals sign is a single quote then double quote, then after
the ampersand is a double quote, single quote, double quote.
 
It is perhaps the wrong hour of the morning to be trying to use my brain,
but:
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

Damian S said:
Hi Mr.Kane,

If login_ID is a number, you do not need the extra quotes at all... If it
is a string, try using a single quote like this:

DLookup("Staff_Password", "Staff", "[Staff_ID]='" & Me.LogIn_ID & "'")

You might also want to consider checking for null in case you have no
matching Staff in the table with the entered Staff_ID. Also, just to
prevent
confusion, if you are calling it Staff_ID in the table, why not call it
Staff_ID on your form also for consistency.

Hope this helps.

Damian.


where after the equals sign is a single quote then double quote, then
after
the ampersand is a double quote, single quote, double quote.

Mr.Kane said:
I am creating a login form and keep running into the same compile
error: "Expected: List separator or )"

Here is the offending code segment:
If Me.Login_PW = DLookup("Staff_Password", "Staff", "[Staff_ID]='"
&Me.LogIn_ID& ""')Then
Staff_Name = Me.LogIn_ID.Value


The highlighted segment of code are the 2 double quotes after
&Me.LogIn_ID&


I'm sure the correct syntax will be obvious after the fact but it's
incredibly frustrating right now.


any help would be appreciated
I am willing to send anyone who can help a screenshot of the error for
your evaluation. I believe
that I have the order correct but it may help you to see the error and
the highlighted code segment.

Thank you,
Marc
 
Damian and David,

Thank you for taking the time out to offer a solution. David's Syntax
suggestion
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

seems to have done the trick, however now I am encoutering the
following error:
Run-Time error '2471'
'the object doesn't contain the Automation object 'Staff_Password."

Any help would be appreciated
-M


It is perhaps the wrong hour of the morning to be trying to use my brain,
but:
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

Damian S said:
Hi Mr.Kane,

If login_ID is a number, you do not need the extra quotes at all... If it
is a string, try using a single quote like this:

DLookup("Staff_Password", "Staff", "[Staff_ID]='" & Me.LogIn_ID & "'")

You might also want to consider checking for null in case you have no
matching Staff in the table with the entered Staff_ID. Also, just to
prevent
confusion, if you are calling it Staff_ID in the table, why not call it
Staff_ID on your form also for consistency.

Hope this helps.

Damian.


where after the equals sign is a single quote then double quote, then
after
the ampersand is a double quote, single quote, double quote.

Mr.Kane said:
I am creating a login form and keep running into the same compile
error: "Expected: List separator or )"

Here is the offending code segment:
If Me.Login_PW = DLookup("Staff_Password", "Staff", "[Staff_ID]='"
&Me.LogIn_ID& ""')Then
Staff_Name = Me.LogIn_ID.Value


The highlighted segment of code are the 2 double quotes after
&Me.LogIn_ID&


I'm sure the correct syntax will be obvious after the fact but it's
incredibly frustrating right now.


any help would be appreciated
I am willing to send anyone who can help a screenshot of the error for
your evaluation. I believe
that I have the order correct but it may help you to see the error and
the highlighted code segment.

Thank you,
Marc
 
Alright guys,

Apparently I have been working way too long on this and just overlooked
the "source" table.

I now have the correct table but am comign across the "Expected list
separator or )" error again.

Here is the current code:
If Me.Login_PW = DLookup("Staff_Password", "Security_Staff",
"[Staff_ID]= '" &Me.LogIn_ID& "'")


This code segment is heighlted by the debugger: &Me.LogIn_ID& "'")
(the double quotes, single quote, dounble quotes portion)

I am baffled.

-M


Mr.Kane said:
Damian and David,

Thank you for taking the time out to offer a solution. David's Syntax
suggestion
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

seems to have done the trick, however now I am encoutering the
following error:
Run-Time error '2471'
'the object doesn't contain the Automation object 'Staff_Password."

Any help would be appreciated
-M


It is perhaps the wrong hour of the morning to be trying to use my brain,
but:
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

Damian S said:
Hi Mr.Kane,

If login_ID is a number, you do not need the extra quotes at all... If it
is a string, try using a single quote like this:

DLookup("Staff_Password", "Staff", "[Staff_ID]='" & Me.LogIn_ID & "'")

You might also want to consider checking for null in case you have no
matching Staff in the table with the entered Staff_ID. Also, just to
prevent
confusion, if you are calling it Staff_ID in the table, why not call it
Staff_ID on your form also for consistency.

Hope this helps.

Damian.


where after the equals sign is a single quote then double quote, then
after
the ampersand is a double quote, single quote, double quote.

:

I am creating a login form and keep running into the same compile
error: "Expected: List separator or )"

Here is the offending code segment:
If Me.Login_PW = DLookup("Staff_Password", "Staff", "[Staff_ID]='"
&Me.LogIn_ID& ""')Then
Staff_Name = Me.LogIn_ID.Value


The highlighted segment of code are the 2 double quotes after
&Me.LogIn_ID&


I'm sure the correct syntax will be obvious after the fact but it's
incredibly frustrating right now.


any help would be appreciated
I am willing to send anyone who can help a screenshot of the error for
your evaluation. I believe
that I have the order correct but it may help you to see the error and
the highlighted code segment.

Thank you,
Marc
 
Alright guys,

Apparently I have been working way too long on this and just overlooked

the "source" table.

I now have the correct table but am coming across the "Expected list
separator or )" error again.

Here is the current code:
If Me.Login_PW = DLookup("Staff_Password", "Security_Staff",
"[Staff_ID]= '" &Me.LogIn_ID& "'")

This code segment is highlighted by the debugger: &Me.LogIn_ID& "'")
(the double quotes, single quote, double quotes portion)

I am baffled.
-M


Mr.Kane said:
Damian and David,

Thank you for taking the time out to offer a solution. David's Syntax
suggestion
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

seems to have done the trick, however now I am encoutering the
following error:
Run-Time error '2471'
'the object doesn't contain the Automation object 'Staff_Password."

Any help would be appreciated
-M


It is perhaps the wrong hour of the morning to be trying to use my brain,
but:
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

Damian S said:
Hi Mr.Kane,

If login_ID is a number, you do not need the extra quotes at all... If it
is a string, try using a single quote like this:

DLookup("Staff_Password", "Staff", "[Staff_ID]='" & Me.LogIn_ID & "'")

You might also want to consider checking for null in case you have no
matching Staff in the table with the entered Staff_ID. Also, just to
prevent
confusion, if you are calling it Staff_ID in the table, why not call it
Staff_ID on your form also for consistency.

Hope this helps.

Damian.


where after the equals sign is a single quote then double quote, then
after
the ampersand is a double quote, single quote, double quote.

:

I am creating a login form and keep running into the same compile
error: "Expected: List separator or )"

Here is the offending code segment:
If Me.Login_PW = DLookup("Staff_Password", "Staff", "[Staff_ID]='"
&Me.LogIn_ID& ""')Then
Staff_Name = Me.LogIn_ID.Value


The highlighted segment of code are the 2 double quotes after
&Me.LogIn_ID&


I'm sure the correct syntax will be obvious after the fact but it's
incredibly frustrating right now.


any help would be appreciated
I am willing to send anyone who can help a screenshot of the error for
your evaluation. I believe
that I have the order correct but it may help you to see the error and
the highlighted code segment.

Thank you,
Marc
 
way, way too long. Have you forgotten so soon:
David's Syntax suggestion
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

Mr.Kane said:
Alright guys,

Apparently I have been working way too long on this and just overlooked

the "source" table.

I now have the correct table but am coming across the "Expected list
separator or )" error again.

Here is the current code:
If Me.Login_PW = DLookup("Staff_Password", "Security_Staff",
"[Staff_ID]= '" &Me.LogIn_ID& "'")

This code segment is highlighted by the debugger: &Me.LogIn_ID& "'")
(the double quotes, single quote, double quotes portion)

I am baffled.
-M


Mr.Kane said:
Damian and David,

Thank you for taking the time out to offer a solution. David's Syntax
suggestion
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

seems to have done the trick, however now I am encoutering the
following error:
Run-Time error '2471'
'the object doesn't contain the Automation object 'Staff_Password."

Any help would be appreciated
-M


It is perhaps the wrong hour of the morning to be trying to use my
brain,
but:
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

Hi Mr.Kane,

If login_ID is a number, you do not need the extra quotes at all...
If it
is a string, try using a single quote like this:

DLookup("Staff_Password", "Staff", "[Staff_ID]='" & Me.LogIn_ID &
"'")

You might also want to consider checking for null in case you have no
matching Staff in the table with the entered Staff_ID. Also, just to
prevent
confusion, if you are calling it Staff_ID in the table, why not call
it
Staff_ID on your form also for consistency.

Hope this helps.

Damian.


where after the equals sign is a single quote then double quote, then
after
the ampersand is a double quote, single quote, double quote.

:

I am creating a login form and keep running into the same compile
error: "Expected: List separator or )"

Here is the offending code segment:
If Me.Login_PW = DLookup("Staff_Password", "Staff", "[Staff_ID]='"
&Me.LogIn_ID& ""')Then
Staff_Name = Me.LogIn_ID.Value


The highlighted segment of code are the 2 double quotes after
&Me.LogIn_ID&


I'm sure the correct syntax will be obvious after the fact but it's
incredibly frustrating right now.


any help would be appreciated
I am willing to send anyone who can help a screenshot of the error
for
your evaluation. I believe
that I have the order correct but it may help you to see the error
and
the highlighted code segment.

Thank you,
Marc
 
Hi Mr.Kane,

Try opening the immediate window (Ctrl-G) and typing
? DLookup("Staff_Password", "Security_Staff", "[Staff_ID]= '" & Me.LogIn_ID
& "'")

(including the question mark), and that will let you know if the dlookup
portion is working correctly. You may need to replace the me.LogIn_ID with
forms!frmName.LogIn_ID, and ensure that you have the form open.

Damian.


Mr.Kane said:
Alright guys,

Apparently I have been working way too long on this and just overlooked

the "source" table.

I now have the correct table but am coming across the "Expected list
separator or )" error again.

Here is the current code:
If Me.Login_PW = DLookup("Staff_Password", "Security_Staff",
"[Staff_ID]= '" &Me.LogIn_ID& "'")

This code segment is highlighted by the debugger: &Me.LogIn_ID& "'")
(the double quotes, single quote, double quotes portion)

I am baffled.
-M


Mr.Kane said:
Damian and David,

Thank you for taking the time out to offer a solution. David's Syntax
suggestion
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

seems to have done the trick, however now I am encoutering the
following error:
Run-Time error '2471'
'the object doesn't contain the Automation object 'Staff_Password."

Any help would be appreciated
-M


It is perhaps the wrong hour of the morning to be trying to use my brain,
but:
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

Hi Mr.Kane,

If login_ID is a number, you do not need the extra quotes at all... If it
is a string, try using a single quote like this:

DLookup("Staff_Password", "Staff", "[Staff_ID]='" & Me.LogIn_ID & "'")

You might also want to consider checking for null in case you have no
matching Staff in the table with the entered Staff_ID. Also, just to
prevent
confusion, if you are calling it Staff_ID in the table, why not call it
Staff_ID on your form also for consistency.

Hope this helps.

Damian.


where after the equals sign is a single quote then double quote, then
after
the ampersand is a double quote, single quote, double quote.

:

I am creating a login form and keep running into the same compile
error: "Expected: List separator or )"

Here is the offending code segment:
If Me.Login_PW = DLookup("Staff_Password", "Staff", "[Staff_ID]='"
&Me.LogIn_ID& ""')Then
Staff_Name = Me.LogIn_ID.Value


The highlighted segment of code are the 2 double quotes after
&Me.LogIn_ID&


I'm sure the correct syntax will be obvious after the fact but it's
incredibly frustrating right now.


any help would be appreciated
I am willing to send anyone who can help a screenshot of the error for
your evaluation. I believe
that I have the order correct but it may help you to see the error and
the highlighted code segment.

Thank you,
Marc
 
Guys,

Thanks again, the DLookup is now working, however I am rendering a
"type mismatch" error

Here is the code:
If Me.Login_PW = DLookup("Staff_Password", "Security_Staff",
"[Staff_Name]= '" & Me.LogIn_ID & "'") Then
Staff_Name = Me.LogIn_ID

The debugger is pointing to "Staff_Name = Me.LogIn_ID"

Me.LogIn_ID is a string

-M


Damian said:
Hi Mr.Kane,

Try opening the immediate window (Ctrl-G) and typing
? DLookup("Staff_Password", "Security_Staff", "[Staff_ID]= '" & Me.LogIn_ID
& "'")

(including the question mark), and that will let you know if the dlookup
portion is working correctly. You may need to replace the me.LogIn_ID with
forms!frmName.LogIn_ID, and ensure that you have the form open.

Damian.


Mr.Kane said:
Alright guys,

Apparently I have been working way too long on this and just overlooked

the "source" table.

I now have the correct table but am coming across the "Expected list
separator or )" error again.

Here is the current code:
If Me.Login_PW = DLookup("Staff_Password", "Security_Staff",
"[Staff_ID]= '" &Me.LogIn_ID& "'")

This code segment is highlighted by the debugger: &Me.LogIn_ID& "'")
(the double quotes, single quote, double quotes portion)

I am baffled.
-M


Mr.Kane said:
Damian and David,

Thank you for taking the time out to offer a solution. David's Syntax
suggestion
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

seems to have done the trick, however now I am encoutering the
following error:
Run-Time error '2471'
'the object doesn't contain the Automation object 'Staff_Password."

Any help would be appreciated
-M



David F Cox wrote:
It is perhaps the wrong hour of the morning to be trying to use my brain,
but:
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

Hi Mr.Kane,

If login_ID is a number, you do not need the extra quotes at all... If it
is a string, try using a single quote like this:

DLookup("Staff_Password", "Staff", "[Staff_ID]='" & Me.LogIn_ID & "'")

You might also want to consider checking for null in case you have no
matching Staff in the table with the entered Staff_ID. Also, just to
prevent
confusion, if you are calling it Staff_ID in the table, why not call it
Staff_ID on your form also for consistency.

Hope this helps.

Damian.


where after the equals sign is a single quote then double quote, then
after
the ampersand is a double quote, single quote, double quote.

:

I am creating a login form and keep running into the same compile
error: "Expected: List separator or )"

Here is the offending code segment:
If Me.Login_PW = DLookup("Staff_Password", "Staff", "[Staff_ID]='"
&Me.LogIn_ID& ""')Then
Staff_Name = Me.LogIn_ID.Value


The highlighted segment of code are the 2 double quotes after
&Me.LogIn_ID&


I'm sure the correct syntax will be obvious after the fact but it's
incredibly frustrating right now.


any help would be appreciated
I am willing to send anyone who can help a screenshot of the error for
your evaluation. I believe
that I have the order correct but it may help you to see the error and
the highlighted code segment.

Thank you,
Marc
 
Is staff_name also a text field?

Mr.Kane said:
Guys,

Thanks again, the DLookup is now working, however I am rendering a
"type mismatch" error

Here is the code:
If Me.Login_PW = DLookup("Staff_Password", "Security_Staff",
"[Staff_Name]= '" & Me.LogIn_ID & "'") Then
Staff_Name = Me.LogIn_ID

The debugger is pointing to "Staff_Name = Me.LogIn_ID"

Me.LogIn_ID is a string

-M


Damian said:
Hi Mr.Kane,

Try opening the immediate window (Ctrl-G) and typing
? DLookup("Staff_Password", "Security_Staff", "[Staff_ID]= '" & Me.LogIn_ID
& "'")

(including the question mark), and that will let you know if the dlookup
portion is working correctly. You may need to replace the me.LogIn_ID with
forms!frmName.LogIn_ID, and ensure that you have the form open.

Damian.


Mr.Kane said:
Alright guys,

Apparently I have been working way too long on this and just overlooked

the "source" table.

I now have the correct table but am coming across the "Expected list
separator or )" error again.

Here is the current code:
If Me.Login_PW = DLookup("Staff_Password", "Security_Staff",
"[Staff_ID]= '" &Me.LogIn_ID& "'")

This code segment is highlighted by the debugger: &Me.LogIn_ID& "'")
(the double quotes, single quote, double quotes portion)

I am baffled.
-M


Mr.Kane wrote:
Damian and David,

Thank you for taking the time out to offer a solution. David's Syntax
suggestion
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

seems to have done the trick, however now I am encoutering the
following error:
Run-Time error '2471'
'the object doesn't contain the Automation object 'Staff_Password."

Any help would be appreciated
-M



David F Cox wrote:
It is perhaps the wrong hour of the morning to be trying to use my brain,
but:
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

Hi Mr.Kane,

If login_ID is a number, you do not need the extra quotes at all... If it
is a string, try using a single quote like this:

DLookup("Staff_Password", "Staff", "[Staff_ID]='" & Me.LogIn_ID & "'")

You might also want to consider checking for null in case you have no
matching Staff in the table with the entered Staff_ID. Also, just to
prevent
confusion, if you are calling it Staff_ID in the table, why not call it
Staff_ID on your form also for consistency.

Hope this helps.

Damian.


where after the equals sign is a single quote then double quote, then
after
the ampersand is a double quote, single quote, double quote.

:

I am creating a login form and keep running into the same compile
error: "Expected: List separator or )"

Here is the offending code segment:
If Me.Login_PW = DLookup("Staff_Password", "Staff", "[Staff_ID]='"
&Me.LogIn_ID& ""')Then
Staff_Name = Me.LogIn_ID.Value


The highlighted segment of code are the 2 double quotes after
&Me.LogIn_ID&


I'm sure the correct syntax will be obvious after the fact but it's
incredibly frustrating right now.


any help would be appreciated
I am willing to send anyone who can help a screenshot of the error for
your evaluation. I believe
that I have the order correct but it may help you to see the error and
the highlighted code segment.

Thank you,
Marc
 
Thanks guys for your time,

I finally have it working.

I'd like to add some logic to the effect of "if a user enters the
incorrect password 3 times, an error msg is displayed and the
application quits

Any thoughts?

This is the pseudo-code that I have so far:

'If User Enters incorrect password 3 times database will shutdown

intLogonAttempts = intLogonAttempts + 1
If intLogonAttempts > 3 Then
MsgBox "You do not have access to this database.Please contact admin.",
vbCritical, "Restricted Access!"
Application.Quit


-M
Damian said:
Is staff_name also a text field?

Mr.Kane said:
Guys,

Thanks again, the DLookup is now working, however I am rendering a
"type mismatch" error

Here is the code:
If Me.Login_PW = DLookup("Staff_Password", "Security_Staff",
"[Staff_Name]= '" & Me.LogIn_ID & "'") Then
Staff_Name = Me.LogIn_ID

The debugger is pointing to "Staff_Name = Me.LogIn_ID"

Me.LogIn_ID is a string

-M


Damian said:
Hi Mr.Kane,

Try opening the immediate window (Ctrl-G) and typing
? DLookup("Staff_Password", "Security_Staff", "[Staff_ID]= '" & Me.LogIn_ID
& "'")

(including the question mark), and that will let you know if the dlookup
portion is working correctly. You may need to replace the me.LogIn_ID with
forms!frmName.LogIn_ID, and ensure that you have the form open.

Damian.


:

Alright guys,

Apparently I have been working way too long on this and just overlooked

the "source" table.

I now have the correct table but am coming across the "Expected list
separator or )" error again.

Here is the current code:
If Me.Login_PW = DLookup("Staff_Password", "Security_Staff",
"[Staff_ID]= '" &Me.LogIn_ID& "'")

This code segment is highlighted by the debugger: &Me.LogIn_ID& "'")
(the double quotes, single quote, double quotes portion)

I am baffled.
-M


Mr.Kane wrote:
Damian and David,

Thank you for taking the time out to offer a solution. David's Syntax
suggestion
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

seems to have done the trick, however now I am encoutering the
following error:
Run-Time error '2471'
'the object doesn't contain the Automation object 'Staff_Password."

Any help would be appreciated
-M



David F Cox wrote:
It is perhaps the wrong hour of the morning to be trying to use my brain,
but:
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

Hi Mr.Kane,

If login_ID is a number, you do not need the extra quotes at all... If it
is a string, try using a single quote like this:

DLookup("Staff_Password", "Staff", "[Staff_ID]='" & Me.LogIn_ID & "'")

You might also want to consider checking for null in case you have no
matching Staff in the table with the entered Staff_ID. Also, just to
prevent
confusion, if you are calling it Staff_ID in the table, why not call it
Staff_ID on your form also for consistency.

Hope this helps.

Damian.


where after the equals sign is a single quote then double quote, then
after
the ampersand is a double quote, single quote, double quote.

:

I am creating a login form and keep running into the same compile
error: "Expected: List separator or )"

Here is the offending code segment:
If Me.Login_PW = DLookup("Staff_Password", "Staff", "[Staff_ID]='"
&Me.LogIn_ID& ""')Then
Staff_Name = Me.LogIn_ID.Value


The highlighted segment of code are the 2 double quotes after
&Me.LogIn_ID&


I'm sure the correct syntax will be obvious after the fact but it's
incredibly frustrating right now.


any help would be appreciated
I am willing to send anyone who can help a screenshot of the error for
your evaluation. I believe
that I have the order correct but it may help you to see the error and
the highlighted code segment.

Thank you,
Marc
 
The above listed logic has been successfully added as well

You guys can take the night off now ;^)

Thanks again
Marc


Mr.Kane said:
Thanks guys for your time,

I finally have it working.

I'd like to add some logic to the effect of "if a user enters the
incorrect password 3 times, an error msg is displayed and the
application quits

Any thoughts?

This is the pseudo-code that I have so far:

'If User Enters incorrect password 3 times database will shutdown

intLogonAttempts = intLogonAttempts + 1
If intLogonAttempts > 3 Then
MsgBox "You do not have access to this database.Please contact admin.",
vbCritical, "Restricted Access!"
Application.Quit


-M
Damian said:
Is staff_name also a text field?

Mr.Kane said:
Guys,

Thanks again, the DLookup is now working, however I am rendering a
"type mismatch" error

Here is the code:
If Me.Login_PW = DLookup("Staff_Password", "Security_Staff",
"[Staff_Name]= '" & Me.LogIn_ID & "'") Then
Staff_Name = Me.LogIn_ID

The debugger is pointing to "Staff_Name = Me.LogIn_ID"

Me.LogIn_ID is a string

-M


Damian S wrote:
Hi Mr.Kane,

Try opening the immediate window (Ctrl-G) and typing
? DLookup("Staff_Password", "Security_Staff", "[Staff_ID]= '" & Me.LogIn_ID
& "'")

(including the question mark), and that will let you know if the dlookup
portion is working correctly. You may need to replace the me.LogIn_ID with
forms!frmName.LogIn_ID, and ensure that you have the form open.

Damian.


:

Alright guys,

Apparently I have been working way too long on this and just overlooked

the "source" table.

I now have the correct table but am coming across the "Expected list
separator or )" error again.

Here is the current code:
If Me.Login_PW = DLookup("Staff_Password", "Security_Staff",
"[Staff_ID]= '" &Me.LogIn_ID& "'")

This code segment is highlighted by the debugger: &Me.LogIn_ID& "'")
(the double quotes, single quote, double quotes portion)

I am baffled.
-M


Mr.Kane wrote:
Damian and David,

Thank you for taking the time out to offer a solution. David's Syntax
suggestion
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

seems to have done the trick, however now I am encoutering the
following error:
Run-Time error '2471'
'the object doesn't contain the Automation object 'Staff_Password."

Any help would be appreciated
-M



David F Cox wrote:
It is perhaps the wrong hour of the morning to be trying to use my brain,
but:
DLookup("Staff_Password", "Staff", "[Staff_ID]= Me.LogIn_ID")

Hi Mr.Kane,

If login_ID is a number, you do not need the extra quotes at all... If it
is a string, try using a single quote like this:

DLookup("Staff_Password", "Staff", "[Staff_ID]='" & Me.LogIn_ID & "'")

You might also want to consider checking for null in case you have no
matching Staff in the table with the entered Staff_ID. Also, just to
prevent
confusion, if you are calling it Staff_ID in the table, why not call it
Staff_ID on your form also for consistency.

Hope this helps.

Damian.


where after the equals sign is a single quote then double quote, then
after
the ampersand is a double quote, single quote, double quote.

:

I am creating a login form and keep running into the same compile
error: "Expected: List separator or )"

Here is the offending code segment:
If Me.Login_PW = DLookup("Staff_Password", "Staff", "[Staff_ID]='"
&Me.LogIn_ID& ""')Then
Staff_Name = Me.LogIn_ID.Value


The highlighted segment of code are the 2 double quotes after
&Me.LogIn_ID&


I'm sure the correct syntax will be obvious after the fact but it's
incredibly frustrating right now.


any help would be appreciated
I am willing to send anyone who can help a screenshot of the error for
your evaluation. I believe
that I have the order correct but it may help you to see the error and
the highlighted code segment.

Thank you,
Marc
 
Back
Top