Advanced query building??? (new to Access)

N

neills

I have a "Contacts" database that has some data entered
into it from a "paper" list. I want a user to enter the
City and State criteria to a query, which opens a form to
check what has been entered (if any thing) and be able to
enter what has not.
My tables are as follows:

tblContacts:
CompanyName
Address1
City
State
Zip
Phone#

tblCity:
City

tblState:
StateName
StateCd (2 letter abrv.)

I have already created the "AreaFinderqry" that works fine
but, I need to make is EASIER to use for office personnel.
I have tried using a form suggested by Duane Hookom
(http://www.fontstuff.com/access/acctut08.htm). This would
be ideal if it would use the values I specify in the Combo
boxes. In my query criteria for City and State I have set
[Forms]![CitySelectfrm]![ComboCity]
[Forms]![CitySelectfrm]![ComboState]
It opens my Area Finder form to 0 records.
My OK button is as follows:
Private Sub cmdOK_Click()
On Error GoTo Err_cmdOK_Click

Dim stDocName As String

stDocName = "Area Finder"

DoCmd.OpenForm stDocName, acNormal, acEdit
DoCmd.Close acForm, "CitySelectfrm", acSaveNo

Exit_cmdOK_Click:
Exit Sub

Err_cmdOK_Click:
MsgBox Err.Description
Resume Exit_cmdOK_Click

End Sub

What am I doing wrong? Sorry for the long question but I
am stumped!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top