How to change the query parameter for a form based on a query

wolfspecter13

New member
Local time
Today, 16:42
Joined
Nov 24, 2012
Messages
5
I am a VBA neophyte but already have one form - based on a student name-and-ID table (not a query) running fine. Access 2010, Windows 7.

I created a new form, very similar in format, but based on a simple query that allows me to input the course # (###) when the form loads. Works great, just the kids I want in that roster show up.

I have 2 questions. (1) How do get the form to allow me to change/enter a new parameter value without closing the form and reopening it? I tried adding a button to run the base query again, but I get a datasheet with the query elements in it, all blank.

(2) I tried to use the "reset" button code I have working in the other attendance form, to reset all the "TempAttendance" checkboxes to default=No but it is not working in this new form. I looked at the VBA code and tried to adapt the names for controls where I could, but I must be missing something.

I need advice but I do not think this is too difficult to fix.

Attaching two Word docs with the VBA from both forms and the form design layouts, plus the new query that displays a single roster, upon which the new form is based.

I am thankful for any help anyone can offer!

L B TagueView attachment VBA from the new form Part 1 of 2.doc

View attachment VBA from the original form Part 2 of 2.doc
 
for an item in the form (say cboBox) to use as a param,put it in the query....
select * from table where [field] = forms!myForm!cboBox
 
I added an unbound control in the footer of the form, LoadRosterActivityID.

I changed the value for ActivityID in the query to
ActivityID: [Forms]![frmSelectRosterByActivityVer2]![LoadRosterActID]

Saved it, closed.

The form opens with every kid in the roster file showing, all courses, and I enter a roster Activity ID in that unbound control, and hit Enter,

Ver2Load.jpg

View attachment Version2 query and form.doc

and it just sits there. Nothing.

Could you provide a few more specifics?

Thanks!

LBT
 

Users who are viewing this thread

Back
Top Bottom