Queries problems, subform problems...

  • Thread starter Thread starter Erj
  • Start date Start date
E

Erj

Guest
I am having a problem with my queries. I have a form which gets its data from a query, the form itself has several subforms, and the query gets its data from several tables.

I need to refresh the query having changed one of the parameters once a change has been made on the form. I have something called clientID on the query and am using that key to link to a sub form, but when I choose a different ClientID on the subform, want the Master form (is that the right name ?) to refresh itself. Only problem is that ClientID is a autonumber.

Because I am useless at explaining this I have put in a link to the database below.

http://www.kennedyscott.co.uk/Test.zip

I am sure there are other things wrong with this database but as I am trying to learn as I go along I am not too worried about those. Just need it to work !

The problem lies in the "2 All Clients" form. In the subform "Course and Clients".

Thanks !!
 
Last edited:
As I said, I am useless at explaining things. I think all I am after is a way of changing an autonumber on a main form to match a corresponding value on a subform.

So when someone clicks on the next button on the subform, all the fields on the master form are updated to the new record.

They say a picture is worth a thousand words, well, lets see is this is any better.

http://www.kennedyscott.co.uk/Problem with subform.jpg

Any ideas appreciated !
 
How about:

Private Sub Form_DblClick(Cancel As Integer)
' Find the record that matches the control.
Dim rs As Object
Set rs = Parent.Recordset.Clone
rs.FindFirst "[Autonumber_Field] = " & Me.Subform_Key_Field
Parent.Bookmark = rs.Bookmark
set rs = Nothing
End Sub


Matt
 
Thanks Matthew,

Haven't had much time to work on it lately but the few mins I spent on it shows that this could be the right kind of thing.

Just out of curiousity, because I am so bad at explaining things, I was hoping you could tell me how you managed to understand what I was talking about. Was it the picture ( :cool: ) or the database download ? Or aybe the description ?

Whatever it was you sure understood well.

Thanks again Mathew.

Erj.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom