Newbie Qusetion

  • Thread starter Thread starter Someone Curious
  • Start date Start date
S

Someone Curious

Hi all

First of all sorry if this is posted in the wrong spot but anyway.

I have a probably simple question I normally program in C++ and I need to
make a small addition to an access database written by someone else and my
access experience is zero.

In a report I have an onactivate event I want to hard code it goes something
like this.

my data is extracted in a query called "My Special Query"

My Actual Table.FirstName is a field I want to validate.

Inside routine......

if [My Actual Table.FirstName].value = "Fred" Then
MySubRoutine
else
MyOtherSubRoutine
end if

My sub routines that are called work correctly as when I call them the react
as expected. However the above tells me the field does not exist. Do I need
to address the query or just the data all the names have spaces this seems
to make a difference.

TIA
 
Try:

[My Actual Table].[FirstName]

The value property is the default property and can't be refered to in a
query. If it's a form reference in the query, use:

[Forms]![FormName]![ControlName]
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Thanks Arvin

Maybe I wasnt clear and may not make any difference. But is there any
difference if the reference to the query is inside a report event?

TIA



Arvin Meyer said:
Try:

[My Actual Table].[FirstName]

The value property is the default property and can't be refered to in a
query. If it's a form reference in the query, use:

[Forms]![FormName]![ControlName]
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

Someone Curious said:
Hi all

First of all sorry if this is posted in the wrong spot but anyway.

I have a probably simple question I normally program in C++ and I need to
make a small addition to an access database written by someone else and
my
access experience is zero.

In a report I have an onactivate event I want to hard code it goes something
like this.

my data is extracted in a query called "My Special Query"

My Actual Table.FirstName is a field I want to validate.

Inside routine......

if [My Actual Table.FirstName].value = "Fred" Then
MySubRoutine
else
MyOtherSubRoutine
end if

My sub routines that are called work correctly as when I call them the react
as expected. However the above tells me the field does not exist. Do I need
to address the query or just the data all the names have spaces this
seems
to make a difference.

TIA
 
Yes. You can't run a query from inside a report event. You can change the
recordsource of a report in the report's OnOpen event, but that's the extent
of it.

You can run an action query from a form event. You can also open a select
query from a form, but you can't read from it without a recordset. Perhaps
it might be a good idea if you'd explain what you are trying to do.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

Someone Curious said:
Thanks Arvin

Maybe I wasnt clear and may not make any difference. But is there any
difference if the reference to the query is inside a report event?

TIA



Arvin Meyer said:
Try:

[My Actual Table].[FirstName]

The value property is the default property and can't be refered to in a
query. If it's a form reference in the query, use:

[Forms]![FormName]![ControlName]
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

Someone Curious said:
Hi all

First of all sorry if this is posted in the wrong spot but anyway.

I have a probably simple question I normally program in C++ and I need to
make a small addition to an access database written by someone else and
my
access experience is zero.

In a report I have an onactivate event I want to hard code it goes something
like this.

my data is extracted in a query called "My Special Query"

My Actual Table.FirstName is a field I want to validate.

Inside routine......

if [My Actual Table.FirstName].value = "Fred" Then
MySubRoutine
else
MyOtherSubRoutine
end if

My sub routines that are called work correctly as when I call them the react
as expected. However the above tells me the field does not exist. Do I need
to address the query or just the data all the names have spaces this
seems
to make a difference.

TIA
 

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

Back
Top