Need value to show from a different table...

K

Kelvin Beaton

I have a form that has a data source of qry_login.

I want to display a value from a table qry_SQLConnect called "SQLServerDB"

I used the expression builder and came up with this,
=qry_SQLConnect.SQLServerDB, but when I view the form I just get #Name?

Can I have the form based on one source and a test box display a value from
a different source?

Any help would be appreciated!!!

Kelvin
 
K

Kelvin Beaton

Thanks that works great!

Now I'd like to make the displaying of this information conditional.
Neither of these work:
=iif(Right("SQLServerDB","qry_SQLConnect", 4)="test",
DLookUp("SQLServerDB","qry_SQLConnect"), "")
=iif(Right([SQLServerDB].[qry_SQLConnect], 4)="test",
(DLookUp("SQLServerDB","qry_SQLConnect")), "")

Where am I going wrong with this?

Thanks

Kelvin
 
D

Douglas J. Steele

=IIf(Right(DLookUp("SQLServerDB","qry_SQLConnect"), 4) = "test",
DLookUp("SQLServerDB","qry_SQLConnect"), "")

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Kelvin Beaton said:
Thanks that works great!

Now I'd like to make the displaying of this information conditional.
Neither of these work:
=iif(Right("SQLServerDB","qry_SQLConnect", 4)="test",
DLookUp("SQLServerDB","qry_SQLConnect"), "")
=iif(Right([SQLServerDB].[qry_SQLConnect], 4)="test",
(DLookUp("SQLServerDB","qry_SQLConnect")), "")

Where am I going wrong with this?

Thanks

Kelvin

Douglas J. Steele said:
Use the DLookup function:

=DLookup("SQLServerDB", "qry_SQLConnect")
 
Top