Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quering SubForm

Status
Not open for further replies.

puforee

Technical User
Oct 6, 2006
741
US
I think I lost something in my Brain...good opening statement..yes? Anyway I have a major form with a minor sub form. The minor sub form will have field’s containing information. This minor sub form will have 50 or 60 records. I can use the record selector to step through the records one at a time. But for my users, I want to use a drop down selector to allow them to jump between records on the minor sub form. For some reason, and here is where my brain comes in, I can't remember how to mechanize this action. I can get the minor sub form....dropdown selector, to show the correct information so the users can make the selection....but I have forgotten how to make it re-query the sub form and jump to the selected record. I always have problems requiring a sub form.

Help please....I know this has to be easy and I am sure I have seen it in the past.

Thanks,
 
something like this (untested)

dim rs as dao.recordset
set rs = me.yoursubformcontrol.form.recordset
rs.findfirst "someField = " & me.cmboSearch

'if the combo returns a string then
'rs.findfirst "somefield = '" & me.cmboSearch & "'
 
MajP....thanks for the feedback...let me give you a little more information.

SubForm as looked at from the main form:
Caption: Course Info Tbl subform
Record Source Sql view:
SELECT [Major ATA TBL].ATA, [Major ATA TBL].Subject, [Major ATA TBL].[Teach Time], [Major ATA TBL].Course, [Major ATA TBL].Model, Right([ATA],3) AS Major, [Major ATA TBL].Chapter, [Major ATA TBL].Comments, [Major ATA TBL].MajorID
FROM [Major ATA TBL]
WHERE ((([Major ATA TBL].Course)=[Forms]![SME Setup Form2]![Course]) AND (([Major ATA TBL].Model)=[Forms]![SME Setup Form2]![Model]))
ORDER BY [Major ATA TBL].ATA;

Within the SubForm I have a Dropdown Control:
Combo54
Row Sourse Sql view:
SELECT [Major ATA TBL].MajorID, [Major ATA TBL].Model, [Major ATA TBL].Course, [Major ATA TBL].ATA
FROM [Major ATA TBL]
WHERE ((([Major ATA TBL].Model)=[Forms]![SME Setup Form2]![Model]) AND (([Major ATA TBL].Course)=[Forms]![SME Setup Form2]![Course]))
ORDER BY [Major ATA TBL].ATA;

On the combo54 Event..After Update I want the Subform to be requeired based on the Combo54 MajorID field. This field also appears in the SubForm SQL...last item.

Can you help explain how to do this?


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top