DLookup

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

Hi:

I wold like that is this is true and finds the userid in
the table then open a form...but is not working.

Can anyone help?

If DLookup("userid", "pswc", "UserID = ' & & "'") Then..

Thanks,

Dan
 
If DLookup("userid", "pswc", "UserID = ' & & "'") Then

& ... what? you have no value between the two ampersands. where do you want
the system to get the value for the UserID? from a control on a form? from
an InputBox?
give details of where/how you're using this line of code, please.
 
Hi Tina:

It looks in the table: pswc.

I have modified it but still... not working:

If (DLookup("[UserID]", "[pswc]", _
"[UserID]='" & [UserID] & "'")) Then

It said field:'|'not found?!

Thanks,

Dan

DoCmd.OpenForm stDocName, , , stLinkCriteria
 
is UserID the name of the field in table pswc? is UserID a numeric or text
data type?
is UserID also the name of a control on a form? where is your user inputting
their user id before the code runs?
btw, you can remove the brackets around the field and table names. in VBA,
you usually only need them if a name includes spaces, a special character,
or sometimes a number.


Dan said:
Hi Tina:

It looks in the table: pswc.

I have modified it but still... not working:

If (DLookup("[UserID]", "[pswc]", _
"[UserID]='" & [UserID] & "'")) Then

It said field:'|'not found?!

Thanks,

Dan

DoCmd.OpenForm stDocName, , , stLinkCriteria
-----Original Message-----
If DLookup("userid", "pswc", "UserID = ' & & "'") Then

& ... what? you have no value between the two ampersands. where do you want
the system to get the value for the UserID? from a control on a form? from
an InputBox?
give details of where/how you're using this line of code, please.





.
 
Hi Tina:

Please see below:

UserID is the name of the field in the table pswc. Later
I will make a form to input these user id(s)
UserId is a text field
UserId will be the name of the control later in a form.
now I have the user id(s) just in the table pwsc where the
dlookup is supossed to look

Thanks,

Dan
-----Original Message-----
is UserID the name of the field in table pswc? is UserID a numeric or text
data type?
is UserID also the name of a control on a form? where is your user inputting
their user id before the code runs?
btw, you can remove the brackets around the field and table names. in VBA,
you usually only need them if a name includes spaces, a special character,
or sometimes a number.


Hi Tina:

It looks in the table: pswc.

I have modified it but still... not working:

If (DLookup("[UserID]", "[pswc]", _
"[UserID]='" & [UserID] & "'")) Then

It said field:'|'not found?!

Thanks,

Dan

DoCmd.OpenForm stDocName, , , stLinkCriteria
-----Original Message-----
If DLookup("userid", "pswc", "UserID = ' & & "'") Then

& ... what? you have no value between the two ampersands. where do you want
the system to get the value for the UserID? from a control on a form? from
an InputBox?
give details of where/how you're using this line of
code,
please.
Hi:

I wold like that is this is true and finds the userid in
the table then open a form...but is not working.

Can anyone help?

If DLookup("userid", "pswc", "UserID = ' & & "'") Then..

Thanks,

Dan


.


.
 
i see that you multi-posted the original question to
microsoft.public.access.modulesdaovba
an hour or so after posting here, after we had already established a dialog.
so i'll leave you to get help in that thread. good luck.


Dan said:
Hi Tina:

Please see below:

UserID is the name of the field in the table pswc. Later
I will make a form to input these user id(s)
UserId is a text field
UserId will be the name of the control later in a form.
now I have the user id(s) just in the table pwsc where the
dlookup is supossed to look

Thanks,

Dan
-----Original Message-----
is UserID the name of the field in table pswc? is UserID a numeric or text
data type?
is UserID also the name of a control on a form? where is your user inputting
their user id before the code runs?
btw, you can remove the brackets around the field and table names. in VBA,
you usually only need them if a name includes spaces, a special character,
or sometimes a number.


Hi Tina:

It looks in the table: pswc.

I have modified it but still... not working:

If (DLookup("[UserID]", "[pswc]", _
"[UserID]='" & [UserID] & "'")) Then

It said field:'|'not found?!

Thanks,

Dan

DoCmd.OpenForm stDocName, , , stLinkCriteria
-----Original Message-----
If DLookup("userid", "pswc", "UserID = ' & & "'") Then

& ... what? you have no value between the two
ampersands. where do you want
the system to get the value for the UserID? from a
control on a form? from
an InputBox?
give details of where/how you're using this line of code,
please.


message
Hi:

I wold like that is this is true and finds the userid in
the table then open a form...but is not working.

Can anyone help?

If DLookup("userid", "pswc", "UserID = ' & & "'")
Then..

Thanks,

Dan


.


.
 
Sorry Tina, but I am runnig out of time...

Thank you anyways and all the best,

Dan
-----Original Message-----
i see that you multi-posted the original question to
microsoft.public.access.modulesdaovba
an hour or so after posting here, after we had already established a dialog.
so i'll leave you to get help in that thread. good luck.


Hi Tina:

Please see below:

UserID is the name of the field in the table pswc. Later
I will make a form to input these user id(s)
UserId is a text field
UserId will be the name of the control later in a form.
now I have the user id(s) just in the table pwsc where the
dlookup is supossed to look

Thanks,

Dan
-----Original Message-----
is UserID the name of the field in table pswc? is
UserID
a numeric or text
data type?
is UserID also the name of a control on a form? where
is
your user inputting
their user id before the code runs?
btw, you can remove the brackets around the field and table names. in VBA,
you usually only need them if a name includes spaces, a special character,
or sometimes a number.


Hi Tina:

It looks in the table: pswc.

I have modified it but still... not working:

If (DLookup("[UserID]", "[pswc]", _
"[UserID]='" & [UserID] & "'")) Then

It said field:'|'not found?!

Thanks,

Dan

DoCmd.OpenForm stDocName, , , stLinkCriteria
-----Original Message-----
If DLookup("userid", "pswc", "UserID = ' & & "'") Then

& ... what? you have no value between the two
ampersands. where do you want
the system to get the value for the UserID? from a
control on a form? from
an InputBox?
give details of where/how you're using this line of code,
please.


message
Hi:

I wold like that is this is true and finds the userid in
the table then open a form...but is not working.

Can anyone help?

If DLookup("userid", "pswc", "UserID = ' & & "'")
Then..

Thanks,

Dan


.



.


.
 
Back
Top