dCount

U

UKAnna

I'm trying to let external users access a data base to place a bid so I need
to let users input their pre assigned User ID and password on a form. On
clicking the command button I want to run a query to check that they are a
valid user and if they are return a short list of the 8 items they can bid
on. I suspect I need to use the dcount function but just cannot make it
work. Any clues appreciated.
 
N

NetworkTrade

you will have set table "PWs"existing containing valid PW and IDs.

when they enter they put their values into the form

you will have a query "CheckPWs"...and this query has criteria which are the
fields on this open form Forms!YourFormName.PW and Forms!.YourFormName.ID

then you run the query behind the scenes

you dcount the result because if there is a match then there will be 1
record and if there is no match there will be no record...

in vb you will
dcount = 1 then continue
dcount <> 1 then messagebox "sorry"

if your dcount does not seem to work correctly....first manually check your
query is working correctly....
 
U

UKAnna

Thanks for the response - you may think I'm a bit thick here but . . .

I do have a set table "PWs"existing containing valid PW and IDs.

and I've got a form that they put their values into. How do I get the
command box (when clicked) to then do the "CheckPWs" and move to the screen
of things they can bid on?

I've tried a Macro which I can't get to work and I've tried an "Expression
Box" which also won't work - i.e. how do I get the query to run behind the
scenes. I understand the dcount result being 1 - I just can't get it to do it
for me!

Is your vb suggestion an alternative or part of the solution along with the
query?

Many many thanks for taking the time to reply

Anna
 
N

NetworkTrade

well you need some VB

you make a macro dedicated to runquery that ChecksPW and then select an
event to trigger that macro so the query will run

select an event to dcount the results of the query with your if/then to
trigger the appropriate messagebox; in this case you probably need pure VB
because I don't think there is a macro preset for this function.

if you are ok with vb but just not sure how to do this task, then in the
programming and forms area of this site you can search on messagebox and on
dcount to see many examples of doing this; also in the event choose the
coding solution and when vb window opens use the vb Help and look up dcount
and it will give you the syntax; but if you have zero comfort going in/out
of VB then you might want local assistance
 
U

UKAnna

NetworkTrade said:
well you need some VB

you make a macro dedicated to runquery that ChecksPW and then select an
event to trigger that macro so the query will run

select an event to dcount the results of the query with your if/then to
trigger the appropriate messagebox; in this case you probably need pure VB
because I don't think there is a macro preset for this function.

if you are ok with vb but just not sure how to do this task, then in the
programming and forms area of this site you can search on messagebox and on
dcount to see many examples of doing this; also in the event choose the
coding solution and when vb window opens use the vb Help and look up dcount
and it will give you the syntax; but if you have zero comfort going in/out
of VB then you might want local assistance
 
U

UKAnna

I'll give it a go but I've got a pretty low level of confidence I'm going to
get this to work. Many thanks again.
 

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

Similar Threads

Data from multiple database tables 4
DCount on multivalue fields 2
database or other software? 4
Anyone live near 0
dcount 1
SUMIF Help 4
custom autonumber 2
DCount with multiple criteria 1

Top