Hi Julia,
the post doesn't say how much coding you have done with Access, so I am
guessing about how much code and explanations to put in here.
--for the click event of the cmd button put code something like this:
DoCmd.OpenForm "frmOwner", , , , , acDialog
--this will open the form that has the combo for project owner and the main
form will wait until a user closes frmOwner.
--instead of closing frmOwner you can just hide it so that you can get the
user's choice from the combo
--put a save button of frmOwner
--code its click event me.visible = false
--now frmOwner will be open but invisible
--to get the user's choice put code something like this
-- with forms!frmOwner
if len(.cboProjectOwner) >0 then
strLinkCriteria = "[OwnerID] = " & .cboProjectOwner & ""
else
end if
end with
so we have something like below:
Private cmdGetProjectOwner_Click()
Dim strLinkCriteria as string
DoCmd.OpenForm "frmOwner", , , , , acDialog
with forms!frmOwner
if len(.cboProjectOwner) >0 then
strLinkCriteria = "[OwnerID] = " & .cboProjectOwner & ""
else
end if
end with
docmd.close acform, "frmOwner"
docmd.openform "frmProject", , , strLinkCriteria
docmd.close acform, Me.name
End sub
** if OwnerID as a text field then use
strLinkCriteria = "[OwnerID] = """ & cboProjectOwner & """"
frmOwner is the name of the form with the combo
frmProject is the form that opens with the projects from that project owner
OwnerID is the bound column of the combo
Jeanette Cunningham
Julia said:
Hi,
I would like to add a function to a database so that:
* users click on a command button on one form
* a pop up window with a combo box appears to allow people to select a
project owner name.
*a second form opens with only the projects from that project owner.
But as a newbie I am finding it rather difficult.
Can you help me?
Thanks,
Julia