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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refer to Subform in Query 1

Status
Not open for further replies.

kirstenlargent

Technical User
Sep 30, 2001
43
US
I need to refer to a subform field in a query. It pulls the info if my subform field is text, but if I try to refer to a number field on the subform, all I get is a character like this:  I get a blank field when I try to refer to a date. Yet all the text fields pull in fine.
I'm referring to the subform control like this in the query: SchoolID: [Forms]![fmain]![fSchoolsAgenda].[Form]![SchoolID]
Where fMain is the main form, and fSchoolsAgenda is the subform, and SchoolID is the control name on the subform.
Any ideas why it won't pull numbers and dates, but it WILL pull text fields?!
 
What happens if you specify the data type of your control in your Query->Parameters:
[Forms]![fmain]![fSchoolsAgenda].[Form]![SchoolID] Long

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Once I set it under Query->Parameters, I then get a prompt for SchoolID.
If I set it for General Number in the field properties, it still won't work.
I've been fiddling with it for awhile, and I can get it to show up now if I multiply the number by 1. So my field now looks like this:
SchoolID: [Forms]![fmain]![fSchoolsAgenda].[Form]![SchoolID]*1

I guess I can live with that work-around, I just think it's odd that it won't pull anything but text.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top