A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Combo Box



 
 
Thread Tools Display Modes
  #1  
Old March 10th, 2010, 12:09 AM posted to microsoft.public.access
Hesham Sakr
external usenet poster
 
Posts: 13
Default Combo Box

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??


  #2  
Old March 10th, 2010, 01:01 AM posted to microsoft.public.access
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Combo Box

On Tue, 9 Mar 2010 16:09:01 -0800, Hesham Sakr
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]
  #3  
Old March 11th, 2010, 04:02 PM posted to microsoft.public.access
De Jager
external usenet poster
 
Posts: 393
Default Combo Box


"Hesham Sakr" wrote in message
...
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??



  #4  
Old March 17th, 2010, 01:33 PM posted to microsoft.public.access
joelgeraldine
external usenet poster
 
Posts: 201
Default Combo Box

µù*

^


"Hesham Sakr" a écrit dans le message
de groupe de discussion :
...
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??


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:50 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.