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

Accessing Form Values Programmatically

Status
Not open for further replies.

mbthaz

Technical User
Aug 29, 2002
44
US
I have a query with criteria that can come from either a form control that is set with data, or from a variable that is culled from the environment by another function. Psuedo code goes like this:

If Form.reports.combo1 <> Null
Then Criteria = Form.reports.combo1
Else Criteria = Lookname()
Return Criteria


How do I code this in Access Basic?

Thanks in advance.

Mike
 

Public function GetCriteria as string

If nz(forms!reports.combo1.value,0) <> 0 then
GetCriteria = forms!reports.combo1.value
Else
GetCriteria = lockname()
Endif

End function
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
Thank you, had almost exactly that, but couldn't figure out how to reference the form control value. It is much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top