Parameters, Combo Box and Forms

A

aaearhart

I'm trying to use a macro in ofrm_Options to select ProjectName and therefore
open the frm_Projects form displaying only the selected ProjectName.

tbl_Projects = all Project data including field "ProjectName"

ofrm_ProjectSelector = ComboBox "ProjectName" (values =
tbl_Projects.ProjectName)
CommandButton "OK" runs macro_ProjectSelector

frm_Projects = all Project data from tbl_Projects
ComboBox "ProjectName" (values = tbl_Projects.ProjectName)

macro_ProjectSelector = OpenForm =
Form Name: frm_Projects
View: Form
Where Condition:
[tbl_Projects]![ProjectName]=[Forms]![ofrm_ProjectSelector]![ProjectName]

So, the Project Selector window opens, I select a Project from the drop-down
menu, click OK and the Projects form opens and an empty record set is
displayed.

I realise I can do this by simply setting the data source of frm_Projects to
an SQL statement involving a WHERE ((ProjectName) Like [Enter Project Name])
clause. This does not suit my purposes for this project.

What am I missing here?

Thanks, muchly!
/amelia
 
K

Ken Snell [MVP]

You first mentioned a form named "ofrm_Options", but your macro references a
form named "ofrm_ProjectSelector". By chance is "ofrm_ProjectSelector" a
subform in "ofrm_Options"? Or else what is the correct setup?
 
K

Ken Snell [MVP]

Try this as your Where Condition argument:

[ProjectName]=[Forms]![ofrm_ProjectSelector]![ProjectName]


or this:

[tbl_Projects].[ProjectName]=[Forms]![ofrm_ProjectSelector]![ProjectName]
 

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

Top