Query help please!

T

TotallyConfused

I have the following on a click event on "Followup" command button. On
clicking this button it open a param form. It looks at pts assoc with doc.
There maybe more than one pt. If the "appt" or "followup" field dates are
null it will open form to enable to enter info reg pts assoc with doc.
However if "appt" and Followup is filled with a date then that particular
form will not open for that pt. which works fine. However, if there are
more than one pt. and "appt" or "followup" has a date on the first pt then
when I click on the "Followup" command button will not open form at all. Can
someone help with this please. How do I fix so that even if a date is in
"appt" or "followup" fields for first pt for will open for 2nd or 3rd pts.
Thank you.

If IsNull([Appt]) And IsNull([Followup]) Then
DoCmd.OpenForm "NoticeForm", acNormal, , "[DocID] = " & Me![DocID], ,
acDialog
End If

Exit_Followup_Click:
Exit Sub
 
S

Steve Schapel

Totally,

I assume this is a continuous view form, and the Followup button is in
the form header section? Or else it is a continuous view subform, and
the Followup button is on the main form?

One way to handle this type of situation is to put the Followup button
in the detail section of the form. You might need to make it small and
neat. That means it will show alongside every record. And then when
you click it for the record you want, then the "Me![DocID]" in your code
will refer to the right value.

Hope that makes sense...
 

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