where condition

A

andrew12

Hi,

Alright I have a issue with one of my Macros. What I am trying to do is dbl
click a field in a form (datasheet view) and open another form with the same
record.

I created the macro to open the secondary form and in the where condition I
entered: [FieldName]=[Forms]![Form1]![Form2]![FieldName]

The macro opens Form2 but, it is empty?

Please help
 
S

Steve Schapel

Andrew,

It is not entirely clear what you are referring to, but I imagine what
you are looking for is:
[FieldName]=[Forms]![Form1]![FieldName]
 
A

andrew12

Thanks for the help Steve, but unfortunatly It gave me the same result (form
with no data).
I guess I will explain the problem with more details.

My objective is to open form2 with the same record by dbl clicking a feild
in form1 (datasheet view)

Form1: Datasheet view purpose to locate records faster (record source-query)

Form2: Form view pupose data entry more details (record source-table)
--
thanks
-Andrew


Steve Schapel said:
Andrew,

It is not entirely clear what you are referring to, but I imagine what
you are looking for is:
[FieldName]=[Forms]![Form1]![FieldName]

--
Steve Schapel, Microsoft Access MVP
Hi,

Alright I have a issue with one of my Macros. What I am trying to do is dbl
click a field in a form (datasheet view) and open another form with the same
record.

I created the macro to open the secondary form and in the where condition I
entered: [FieldName]=[Forms]![Form1]![Form2]![FieldName]

The macro opens Form2 but, it is empty?

Please help
 
S

Steve Schapel

Andrew,

This would imply that Form2 does not include a record where the value of
FieldName is identical to the value of FieldName in the current record
on Form1.

Can you give the exact details of the Macro, and which Event you are
running the macro on?

Also, as a test, you could try "hard-coding" the value you think you are
filtering by, into the Where Condition argument, e.g.
[FieldName]="Fred"
or...
[FieldName]=123
 
A

andrew12

Sorry about hte delay very busy anyways,

Ok Steve Whoops.. the macro where condition
[feildname]=[forms]![form1]![fieldname] that you suggested works
fine. - "thanks"
My problem was that I have VBA coding that I copied and pasted of curse in
the backround of form 2 that applies to the on load event which opens Form2
with blank fields dah... So my solution was that I made copy of Form2 and
took off the event procedure and directed my macro to open that form instead.
Also it helps to put the name of form1 in the form1 spot of the where
condition not the name of form2 gee... wiz...
Thanks a bunch

--
thanks
-Andrew


Steve Schapel said:
Andrew,

This would imply that Form2 does not include a record where the value of
FieldName is identical to the value of FieldName in the current record
on Form1.

Can you give the exact details of the Macro, and which Event you are
running the macro on?

Also, as a test, you could try "hard-coding" the value you think you are
filtering by, into the Where Condition argument, e.g.
[FieldName]="Fred"
or...
[FieldName]=123

--
Steve Schapel, Microsoft Access MVP
Thanks for the help Steve, but unfortunatly It gave me the same result (form
with no data).
 
S

Steve Schapel

Thanks for letting us know, Andrew, and very happy to hear it's sorted now.
 

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