Question popup selection box

bielie

New member
Local time
Today, 15:28
Joined
Aug 2, 2008
Messages
3
Hi All,

I am a complete newbie when it comes to Access 2007 and I am trying to do something which in my mind should be simple to do, but I cannot get it right.

As a test, I created a table with just one field called "surname", which is also the primary key of course.

Now I created a form with this one field, which displays as a hyperlink "On Screen Only" and I want to do the following:

When I click on this field, I want a list of all the "surnames" to pop up in a simple window which will allow me to select a surname by double-clicking on it and returns it to the form.

What is the easiest way to do this with the minimal coding? If a lot of coding is needed, then so be it.

Thanks,
Bielie
 
See the attached file--just one line of code used. Not precisely what you're asking about...but similar...

Regards,
Tim
 

Attachments

Why go to the trouble of using a form? A simple ComboBox would do the trick. And the base form is always current.

Brett
 
Just a thought,

if you have the surname as a primary key, you can only ever have one listing of that surname correct? as it is a primary key, it should be unique so you can link to unique records but say, if you enter "Smith" as a surnamePK and you had other smiths, then you have trouble on your hands. in he UK, there are thousands of smiths so would not be un common to have multiple records of the same surname.

why not use an autonumber. this will never be replicated and then, you can have a million smiths if you want.


NS
 
Just a thought,

if you have the surname as a primary key, you can only ever have one listing of that surname correct? as it is a primary key, it should be unique so you can link to unique records but say, if you enter "Smith" as a surnamePK and you had other smiths, then you have trouble on your hands. in he UK, there are thousands of smiths so would not be un common to have multiple records of the same surname.

why not use an autonumber. this will never be replicated and then, you can have a million smiths if you want.


NS

Yes, sorry the surname one was a very bad example. My main focus on this is to test how I can open a selection form by pressing a button and then returning the value selected on that form back. This of course, is not the actual project I am working on, but rather just a small test database with 5 rows.

A combo box works fine, but there may be hundreds of values in the list. I think a filter of some sort will have to be considered here.

Anyway, thanks for all the replies!
 
Hi,

i found this on Allen Browns site. it filters as you type and i guess as an addition, you could create code on the OnClick of the field-

Sub OpenMySpecificForm()

Dim StDocName As String
Dim stLinkCriteria As String

stDocName = "YourFormNameFrm" ' name of the form you want to open
StLinkCriteria = "[FieldNameID="Me![FieldNameID] ' field you click with data

DoCmd.OpenForm stDocName, , , stLinkCriteria

End Sub


or something like that anyway.
 

Attachments

Hi,

i found this on Allen Browns site. it filters as you type and i guess as an addition, you could create code on the OnClick of the field-

Sub OpenMySpecificForm()

Dim StDocName As String
Dim stLinkCriteria As String

stDocName = "YourFormNameFrm" ' name of the form you want to open
StLinkCriteria = "[FieldNameID="Me![FieldNameID] ' field you click with data

DoCmd.OpenForm stDocName, , , stLinkCriteria

End Sub

or something like that anyway.


Thanks a lot for that, going to try it right away. Thanks again.
 

Users who are viewing this thread

Back
Top Bottom