From: Hesham Sakr on
Hi,

I want to put a combo box on a form the lists values (PK) of records on
another form. I want to know how when I select a value from the combo box it
can open that other form on the specific record i selected its PK??


From: John W. Vinson on
On Tue, 9 Mar 2010 16:09:01 -0800, Hesham Sakr
<HeshamSakr(a)discussions.microsoft.com> wrote:

>Hi,
>
>I want to put a combo box on a form the lists values (PK) of records on
>another form. I want to know how when I select a value from the combo box it
>can open that other form on the specific record i selected its PK??
>

See the VBA help for the "OpenForm" method. One of its arguments is a
WhereCondition; you can use the AfterUpdate event of the combo to open the
other form, something like

Private Sub mycombo_AfterUpdate()
Dim strDocument As String
Dim strCriteria As String
strDocument = "FormYouWantToOpen"
strCriteria = "[PKFieldname] = " & Me!mycombo
DoCmd.OpenForm strDocument, WhereCondition := strCriteria, <other options>
End Sub
--

John W. Vinson [MVP]
From: De Jager on

"Hesham Sakr" <HeshamSakr(a)discussions.microsoft.com> wrote in message
news:F6D00412-C45D-4A90-88DC-4D4E175979CF(a)microsoft.com...
> Hi,
>
> I want to put a combo box on a form the lists values (PK) of records on
> another form. I want to know how when I select a value from the combo box
> it
> can open that other form on the specific record i selected its PK??
>
>

From: joelgeraldine on
µù*

^


"Hesham Sakr" <HeshamSakr(a)discussions.microsoft.com> a écrit dans le message
de groupe de discussion :
F6D00412-C45D-4A90-88DC-4D4E175979CF(a)microsoft.com...
> Hi,
>
> I want to put a combo box on a form the lists values (PK) of records on
> another form. I want to know how when I select a value from the combo box
> it
> can open that other form on the specific record i selected its PK??
>
>