Home Version Access

A

accessdesigner

I purchased a home version of Access from Microsoft through my job, and when
I tried the following statement using the home version of Access, it wont
recognize [NameThings.NameLOOK] as being correct, but it works at work: (why?)

Dim strwhere As String
strwhere = ""
If Not IsNull(Me.NameList) Then
If Me.NameList = [NameThings.NameLOOK] Then
strwhere = strwhere & Me.NameList
End If
End If
 
D

Douglas J. Steele

I'm surprised it recognizes that in any version.

What is NameThings?

If it's an open form, that should be Forms![NameThings]![NameLOOK]

If it's a table, you need to use a DLookup: DLookup("[NameLOOK]",
"[NameThings]")

If it's a recordset, you need to use NameThings!NameLOOK
 
R

Rick Brandt

accessdesigner said:
I purchased a home version of Access from Microsoft through my job, and when
I tried the following statement using the home version of Access, it wont
recognize [NameThings.NameLOOK] as being correct, but it works at work: (why?)

Dim strwhere As String
strwhere = ""
If Not IsNull(Me.NameList) Then
If Me.NameList = [NameThings.NameLOOK] Then
strwhere = strwhere & Me.NameList
End If
End If

There is no "home version" of Access and your syntax is incorrect. When square
brackets are required they need to go around each reference "piece" not around
the outside as you have them.

If Me.NameList = [NameThings].[NameLOOK] Then...

or since your names don't actually require the brackets...

If Me.NameList = NameThings.NameLOOK Then
 
R

ruralguy via AccessMonster.com

I don't know what a "Home Version" of Access could possible be other than a
retail version of Access. It is probably a later version than you are using
at work. Each version released was a little less forgiving that the prior
version. I believe the correct syntax is:

If Me.NameList = [NameThings].[NameLOOK] Then

If [NameThings] is the name of a table bound to the form you are working on
then I think:

If Me.NameList = [NameLOOK] Then

...will work as well.
I purchased a home version of Access from Microsoft through my job, and when
I tried the following statement using the home version of Access, it wont
recognize [NameThings.NameLOOK] as being correct, but it works at work: (why?)

Dim strwhere As String
strwhere = ""
If Not IsNull(Me.NameList) Then
If Me.NameList = [NameThings.NameLOOK] Then
strwhere = strwhere & Me.NameList
End If
End If
 
A

accessdesigner

when i used ......If Me.NameList = [NameThings].[NameLOOK] Then... an error
message read .....MS ACCESS CAN'T FIND THE FIELD 'l' REFERRED IN YOUR
EXPRESSION

when i used ..... If Me.NameList = NameThings.NameLOOK Then...an error
message read... OBJECT REQUIRED

when i said home version of MS Access... its a version of MS software that
MS allows employees of other companies, such as mine, to purchase for home
use.... (Microsoft Home Use Program,... this product is not for resale)



Rick Brandt said:
accessdesigner said:
I purchased a home version of Access from Microsoft through my job, and when
I tried the following statement using the home version of Access, it wont
recognize [NameThings.NameLOOK] as being correct, but it works at work: (why?)

Dim strwhere As String
strwhere = ""
If Not IsNull(Me.NameList) Then
If Me.NameList = [NameThings.NameLOOK] Then
strwhere = strwhere & Me.NameList
End If
End If

There is no "home version" of Access and your syntax is incorrect. When square
brackets are required they need to go around each reference "piece" not around
the outside as you have them.

If Me.NameList = [NameThings].[NameLOOK] Then...

or since your names don't actually require the brackets...

If Me.NameList = NameThings.NameLOOK Then
 
A

accessdesigner

It's a query, and field name,... i was surprised too that i didnt work,
because it worked at work....

Douglas J. Steele said:
I'm surprised it recognizes that in any version.

What is NameThings?

If it's an open form, that should be Forms![NameThings]![NameLOOK]

If it's a table, you need to use a DLookup: DLookup("[NameLOOK]",
"[NameThings]")

If it's a recordset, you need to use NameThings!NameLOOK


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


accessdesigner said:
I purchased a home version of Access from Microsoft through my job, and
when
I tried the following statement using the home version of Access, it wont
recognize [NameThings.NameLOOK] as being correct, but it works at work:
(why?)

Dim strwhere As String
strwhere = ""
If Not IsNull(Me.NameList) Then
If Me.NameList = [NameThings.NameLOOK] Then
strwhere = strwhere & Me.NameList
End If
End If
 
A

accessdesigner

Okay... too much emphasis on the use of the word home version... through my
job, I purchased the right to use MS Access on my home computer.. they mailed
me the software...im using it at home. however, when i practice using Access
at home, the same thing I did at work, doesnt work here at home...

when i used ......If Me.NameList = [NameThings].[NameLOOK] Then... an error
message read .....MS ACCESS CAN'T FIND THE FIELD 'l' REFERRED IN YOUR
EXPRESSION

when i used ..... If Me.NameList = NameThings.NameLOOK Then...an error
message read... OBJECT REQUIRED

Im trying to get a combobox selection from a form to match what is in my
query named NameThings, under the NameLOOK field...

ruralguy via AccessMonster.com said:
I don't know what a "Home Version" of Access could possible be other than a
retail version of Access. It is probably a later version than you are using
at work. Each version released was a little less forgiving that the prior
version. I believe the correct syntax is:

If Me.NameList = [NameThings].[NameLOOK] Then

If [NameThings] is the name of a table bound to the form you are working on
then I think:

If Me.NameList = [NameLOOK] Then

...will work as well.
I purchased a home version of Access from Microsoft through my job, and when
I tried the following statement using the home version of Access, it wont
recognize [NameThings.NameLOOK] as being correct, but it works at work: (why?)

Dim strwhere As String
strwhere = ""
If Not IsNull(Me.NameList) Then
If Me.NameList = [NameThings.NameLOOK] Then
strwhere = strwhere & Me.NameList
End If
End If
 
G

Granny Spitz via AccessMonster.com

Rick said:
There is no "home version" of Access

The "home version" of Access is a fringe benefit of employees who work for
large companies. It's part of a licensing agreement from Microsoft (and
other software vendors who offer the same thing) where employees who have a
license for Office on their work computer can purchase (or get a free CD) of
the "home version" of retail Office to install on their home computers so
they can work at home. This often happens with antivirus software, since
many companies are willing to foot the bill for more secure computers on
their networks.

I don't know if they still mark them in newer versions, but you can tell you
have a home version of Access when you open a form in form view. There's a
red stripe across the top of the Detail section.
 
T

tina

you can't return a value from a query that way, unless the query is bound to
the form that the code is running from (in which case, all you'd need is the
field reference, as ruralguy pointed out).

if the query NameThings only returns one record, then you can retrieve the
value of the NameLOOK field with a DLookup() function as described by Doug
Steele, and assign it to Me.NameList; otherwise, you're going to need to
apply criteria in the DLookup() to retrieve the appropriate record from the
query.

hth


accessdesigner said:
It's a query, and field name,... i was surprised too that i didnt work,
because it worked at work....

Douglas J. Steele said:
I'm surprised it recognizes that in any version.

What is NameThings?

If it's an open form, that should be Forms![NameThings]![NameLOOK]

If it's a table, you need to use a DLookup: DLookup("[NameLOOK]",
"[NameThings]")

If it's a recordset, you need to use NameThings!NameLOOK


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I purchased a home version of Access from Microsoft through my job, and
when
I tried the following statement using the home version of Access, it wont
recognize [NameThings.NameLOOK] as being correct, but it works at work:
(why?)

Dim strwhere As String
strwhere = ""
If Not IsNull(Me.NameList) Then
If Me.NameList = [NameThings.NameLOOK] Then
strwhere = strwhere & Me.NameList
End If
End If
 
A

accessdesigner

ty Granny... I was trying to keep it simple, but sometimes... well, the
software itself, MS Access 2003, so far, looks like the one at work, (EXCEPT
IT WONT READ A SIMPLE INSTRUCTION)... however, the CD case that it came in,
looks like a "bootleg" no color on it, black and white print with NO RESALE
- Microsoft Home Use Program,... this product is not for resale .... all over
it.....

what about my program statement that still does not work? :-(
 
R

ruralguy via AccessMonster.com

Sorry to pound on you for the "Home Version" thing. Thankfully, Granny set
us all straight. Is the query NameThings bound to your form?
Okay... too much emphasis on the use of the word home version... through my
job, I purchased the right to use MS Access on my home computer.. they mailed
me the software...im using it at home. however, when i practice using Access
at home, the same thing I did at work, doesnt work here at home...

when i used ......If Me.NameList = [NameThings].[NameLOOK] Then... an error
message read .....MS ACCESS CAN'T FIND THE FIELD 'l' REFERRED IN YOUR
EXPRESSION

when i used ..... If Me.NameList = NameThings.NameLOOK Then...an error
message read... OBJECT REQUIRED

Im trying to get a combobox selection from a form to match what is in my
query named NameThings, under the NameLOOK field...
I don't know what a "Home Version" of Access could possible be other than a
retail version of Access. It is probably a later version than you are using
[quoted text clipped - 21 lines]
 
A

accessdesigner

ty... ( need you all on speed dial.... lol)

my combobox is connected to :
SELECT Names.Name FROM [Names] ORDER BY [Name];
(thats a table where my list names scroll down from the combobox

The Query: NameThings .....is only connected to my Report

ruralguy via AccessMonster.com said:
Sorry to pound on you for the "Home Version" thing. Thankfully, Granny set
us all straight. Is the query NameThings bound to your form?
Okay... too much emphasis on the use of the word home version... through my
job, I purchased the right to use MS Access on my home computer.. they mailed
me the software...im using it at home. however, when i practice using Access
at home, the same thing I did at work, doesnt work here at home...

when i used ......If Me.NameList = [NameThings].[NameLOOK] Then... an error
message read .....MS ACCESS CAN'T FIND THE FIELD 'l' REFERRED IN YOUR
EXPRESSION

when i used ..... If Me.NameList = NameThings.NameLOOK Then...an error
message read... OBJECT REQUIRED

Im trying to get a combobox selection from a form to match what is in my
query named NameThings, under the NameLOOK field...
I don't know what a "Home Version" of Access could possible be other than a
retail version of Access. It is probably a later version than you are using
[quoted text clipped - 21 lines]
End If
End If
 
R

ruralguy via AccessMonster.com

Well you can't say you don't get lots of help here, right? LOL

I'll drop out for a while and let the others bury you in fewer questions. ;)
ty... ( need you all on speed dial.... lol)

my combobox is connected to :
SELECT Names.Name FROM [Names] ORDER BY [Name];
(thats a table where my list names scroll down from the combobox

The Query: NameThings .....is only connected to my Report
Sorry to pound on you for the "Home Version" thing. Thankfully, Granny set
us all straight. Is the query NameThings bound to your form?
[quoted text clipped - 19 lines]
 
A

accessdesigner

lol... true... but the delayed response time, and going back and forth on
things not directly related to the problem... and still trying to figure it
out while waiting for the solution.... and still not receiving the solution
QUICKLY, lol.... because logically it is supposed to work...
is quite disturbing.... just give me
your phone number lol...

ruralguy via AccessMonster.com said:
Well you can't say you don't get lots of help here, right? LOL

I'll drop out for a while and let the others bury you in fewer questions. ;)
ty... ( need you all on speed dial.... lol)

my combobox is connected to :
SELECT Names.Name FROM [Names] ORDER BY [Name];
(thats a table where my list names scroll down from the combobox

The Query: NameThings .....is only connected to my Report
Sorry to pound on you for the "Home Version" thing. Thankfully, Granny set
us all straight. Is the query NameThings bound to your form?
[quoted text clipped - 19 lines]
End If
End If
 
R

ruralguy via AccessMonster.com

It looks like *everyone* stopped responding at the same time. If your
NameThings is only used in a report then you will need to use a Domain
function like DLookup() to retrieve data from that query.
lol... true... but the delayed response time, and going back and forth on
things not directly related to the problem... and still trying to figure it
out while waiting for the solution.... and still not receiving the solution
QUICKLY, lol.... because logically it is supposed to work...
is quite disturbing.... just give me
your phone number lol...
Well you can't say you don't get lots of help here, right? LOL
[quoted text clipped - 13 lines]
 
G

Granny Spitz via AccessMonster.com

accessdesigner said:
the CD case that it came in,
looks like a "bootleg" no color on it, black and white print with NO RESALE
- Microsoft Home Use Program,... this product is not for resale .... all over
it.....

It's not a bootleg copy. Your company has the right to make and distribute a
certain number of home use copies to its employees under its license
agreement with Microsoft, and it can use any media it wants for these copies,
even the plain CD-Rs the rest of us can buy at our local store. They're
legal copies as long as they're marked properly and the rules are adhered to,
like the day you leave the company you're required to remove this software
from your home computer even though you *paid* for it. (You actually only
paid for the distribution and administration costs to your company for home
use software, not for the applications on that CD.)
what about my program statement that still does not work? :-(

As pointed out by others, you're using incorrect syntax. The reason code
works in one place and not in another is due to either:

1) You're using it in a different context (different unbound/bound form,
different event, etc.), or
2) You're the victim of one or more bugs, where the code you see in the code
window isn't actually the code being executed at runtime.

The second reason is very hard to find and will cost you days or weeks
chasing red herrings if you develop Access applications for a living and you
don't take steps to avoid these bugs:

1) Always turn off Track Name Autocorrect.
2) Never accept the default name assigned to controls on forms and reports
where you will use these names in code, properties or macros.
3) Never use a name that requires brackets to fix it. ("Name," a reserved
word, is one of these.)
4) Before you run the code again, always save and compile the code after you
make code changes.

It's really, really hard to help you because we have to guess which mistakes
you made when you built your form. I can't duplicate both your error
messages with the form I built with the mistakes I *think* you made, which
means I'm guessing wrong. I *think* you're using a bound form with an
unbound combo box. I *think* your combo box is named NameList and its
rowsource is your query named qryNames, which uses this SQL statement:
SELECT Names.Name FROM [Names] ORDER BY [Name];

But that can't be right because I get "Variable not defined" when I use this
line:

If Me.NameList = NameThings.NameLOOK

... which means ... oh! I know what *that* means. Scroll up to the top of
every module in your application and add this line of code if it's not
already there:

Option Explicit

Save and compile. Now go to Tools | Options | Editor and make sure "Require
Variable Declaration" is checked so this never happens again. Now when you
run that line of code with the bad syntax you'll get the correct error
message.
The Query: NameThings .....is only connected to my Report

... which is on a plane headed for Moscow. Or did I guess wrong again and
NameThings is the query that your current *form* is bound to? Or some other
form is bound to? If it's bound to your current form, does this query
contain a column named NameLOOK which contains only one record that might
match the Name column in the Names table, or does this query use the Names
table as its source?

And I'm still confused what you want to do after looking at your code and
reading this from your other post: "Im trying to get a combobox selection
from a form to match what is in my query named NameThings, under the NameLOOK
field." I *think* you want to concatenate the selected item in the combo box
to strwhere *if* there's a matching item in the qryNames query. But why not
just allow the user to select from the names in the NameThings query instead
of qryNames?

I *think* your ultimate goal is to build a search form which leads me to
believe you'd have a better chance of success if one of the others helped you
with it. I don't build search forms, other than the ones that use the built
in "filter by form" and "filter by selection" toolbar buttons.
 
T

tina

well, i don't know about anybody else, but i'm done trying to help anyone
who complains about the forum and the lack of a QUICK solution from unpaid
volunteers who have been giving up their Sunday leisure to try and figure
out what the situation is, so they can offer a working solution.


ruralguy via AccessMonster.com said:
It looks like *everyone* stopped responding at the same time. If your
NameThings is only used in a report then you will need to use a Domain
function like DLookup() to retrieve data from that query.
lol... true... but the delayed response time, and going back and forth on
things not directly related to the problem... and still trying to figure it
out while waiting for the solution.... and still not receiving the solution
QUICKLY, lol.... because logically it is supposed to work...
is quite disturbing.... just give me
your phone number lol...
Well you can't say you don't get lots of help here, right? LOL
[quoted text clipped - 13 lines]
End If
End If
 
J

John Vinson

ty... ( need you all on speed dial.... lol)

my combobox is connected to :
SELECT Names.Name FROM [Names] ORDER BY [Name];
(thats a table where my list names scroll down from the combobox

The Query: NameThings .....is only connected to my Report

The word Name is a bad Name to Name a field or a control, since both
tables and controls have a Name property already!

Try changing the table definition so that you're using a nonreserved
term in place of Name - or at the very least bracket it.

The difference between the home and work versions *MIGHT* be because
one of them has Name Autocorrect set in the database's Options, and
the other doesn't. IN my experience this misfeature should be turned
OFF.

Perhaps you could post the complete SQL of the NameThings query, with
some indication of the datatypes of the table fields.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top