Command button on one form opens a new form to same subject

J

jez_s

I am still quite new to Access and don't really know any VBA code so I
hope someone might be able to help with this.

I have two forms, each based on queries from the same table,
tblClients. One is a continuous form showing a few details about
clients, including ClientID, ClientName, DateReferred, and so on. The
other form has more detailed information in single form mode, and
shows the same fields (ClientID, etc.) but also several additional
ones.

I wanted to make a command button at the end of each row in the
continuous form that will pop open the detailed form showing the data
from that particular record. I used the command button wizard to do
this and it does open the form, but it doesn't display any data. It
says "Filtered" at the bottom, but the form is totally blank.

Here's what the wizard created for the code:

Private Sub OpenClientDetail_Click()
On Error GoTo Err_OpenClientDetail_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "F-Clients"

stLinkCriteria = "[ClientID]=" & Me![ClientID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_OpenClientDetail_Click:
Exit Sub

Any ideas as to why this is not working?

Thanks in advance

--SJ
 
J

Jeanette Cunningham

Hi jez,
first, do a check with the continuous form open.
Instead of using the button to open the details form, open it yourself from
the database window or navigation bar.
See if the form shows records for any clients - there may be a problem with
the details form.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
J

jez_s

Hi Jeanette,

Thanks for your input...I am not sure what was up with my detailed
form but I just made it over again from scratch and it is now working
a treat. I must have changed a form property somewhere along the
way. Thank you again.

-SJ
 

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