Tecnologia, programação e muito Visual FoxPro.

quinta-feira, 30 de dezembro de 2010

[Access VBA Central] Help with Query by Form

 

I am totally new to VBA and am trying to learn how to write code to perform operations in MS Access. I want to design a form where users can select multiple criteria to run a make table query and ultimately open a report based on that updated table. The database tracks thermometers used in a laboratory.

My form ("QBF_Form_Thermometers") has 2 text boxes and 3 combo boxes:

Name of Combo Box 1:
"ThermType" (Type of thermometer -- digital, Hg, etc.)

Name of Combo Box 2:
"ThermStat" (Status of thermometer -- In use, etc.)

Name of Combo Box 3:
"ThermLoc" (Location of thermometer -- specific lab location)

Name of Text Box 1:
"MinRange" (Minimum temperature range of the thermometer -- a number)

Name of Text Box 2:
"MaxRange" (Maximum temperature range of the thermometer -- a number)

I want users to be able to populate some or all of the boxes on the form to run an associated make-table query ("QBF_Thermometers"). I then want an associated report to open ("Rpt_Thermometers").

I have tried both referring to the form in the query (using for example, [Forms]![QBF_Form_Thermometers]![ThermStat]...) and messing around with SQL statement but have not had much success and think that VBA would be a more efficient solution. Any suggestions on how to do this? Thanks!

__._,_.___
Recent Activity:
.

__,_._,___

Nenhum comentário:

Arquivo do blog