Open a form with a filter (taken from a variable on a replicationID field)

homer2002

Registered User.
Local time
Today, 17:40
Joined
Aug 27, 2002
Messages
152
Hi

Can someone help me.

I'm trying to open a form with a filter.
I'm fine opening a form using VBA code

docmd.openform("blah blah",,'ENTER FILTER HERE')

but when I try to use a variable for the filter all I get is some stupid error message)

the way that I tried originaly was to set up a string variable
say = 'TABLE ='
and then added the search criteria
to get the query as one long string.

I'm using a ReplicationID field to search for .
anyone got any idea's???

in short i'm looking for the syntax somthing like

dosmd.openform("NAMEOFTABLE",,"FIELD = " & variable

but I don't know how to pass a variable of type replicationID

(the error i get is
Malformed GUID in query expression 'staffid={BE78E0B3-B4E6-11D6-8B10-0002A5941B7F}
)
:confused:
 
Last edited:
Ok i've had a rethink.


I've got 2 tables

I have a staff table with staff name and USERID

I have another table which is joined to this (1 to many) to record stats.



STAFF
StaffID is REPLICATIONID (autonumber & Primary key)
nameofstaff is TEXT
UserID is TEXT



STATS
StatID is REPLICATIONID (autonumber & Primary key)
StaffID is - (Foreign key linking to StaffID in staff table)STAFF
+some other fields

what I want to do is to use
docmd.openform ("STATS",, ***WHERE USERID = some string variable)


please help me before i drown in my cup of coffee _\o/_
 

Users who are viewing this thread

Back
Top Bottom