Selecting a specific record by a dropdownlist in a data access pag

Z

Zulay

Good afternoon all:

In my database, the user can enter a new record by filling some
fields on a table I create in a data access page. That part is working
properly, I mean, I can enter information on the fields and the info is
saving on a table in the Access database. What I need to do is to retrieve
the information of a specific record (an specific row of the data base table)
in the same table of the data access page. I see the records added by the
navigation bar but I just need to see a specific record. The record should be
selected by a dropdownlist in which the user would have the opportunity to
select one of the entries of a certain field in the table.
For example, if a have a medical record table, i want the user to
be able to see a specific record by selecting their name from a dropdownlist
and their record must be disply on screen in the same form as when they
filled the record.
I will really appreciated any help. I should finished this
database the next week so I am kind in a hurry and I have not find any
information on the web that would help me. If more information about what I
am trying to do is needed just post me pls. Thanks anticipated again :)
 
G

Golfinray

Add a combo box to your form. Use the wizard and set the combo recordsource
to the one field you want to search on (like name.) In the properties of the
combo go to event and in the afterupdate event go to the code builder. Type:
Me.Filter = "[name] = """ & Me.combo# & """"
Me. Filteron = True
This will allow you to select the name you want and populate the form with
that info.
 
Z

Zulay

Thanks for answering Golfinray. I tried by adding a dropdownlist in the
web page with the purpose to filter the record by the dropdownlist but it did
not work. I am pretty sure that what you suggest me work very well on a
microsoft access form. I tried by making a form and select a record by a
combo box and it worked but it have not work in the data access page.
I am not sure if I can create a select query that will select a record
from the table by a dropdownlist and run it in a VBScript or something
similar. Please advice.
 
G

Golfinray

Sorry, I misread your question. I thought you wanted it for a form. Data
access pages are different animals. Generally, you would have to filter
before it ever gets to the data access page, either in the query or in a
small form. Probably in the query itself. Tell us how your query is set up
and we might be able to give you a solution. Thanks, Ray

Zulay said:
Thanks for answering Golfinray. I tried by adding a dropdownlist in the
web page with the purpose to filter the record by the dropdownlist but it did
not work. I am pretty sure that what you suggest me work very well on a
microsoft access form. I tried by making a form and select a record by a
combo box and it worked but it have not work in the data access page.
I am not sure if I can create a select query that will select a record
from the table by a dropdownlist and run it in a VBScript or something
similar. Please advice.

Golfinray said:
Add a combo box to your form. Use the wizard and set the combo recordsource
to the one field you want to search on (like name.) In the properties of the
combo go to event and in the afterupdate event go to the code builder. Type:
Me.Filter = "[name] = """ & Me.combo# & """"
Me. Filteron = True
This will allow you to select the name you want and populate the form with
that info.
 
Z

Zulay

Thanks again Ray. I will try to give more specific information. I have a
table with several colums that corresponds to each field that can be fill in
the data access page by the user. Two of those colums combine will let me see
a specific record: the part number and the change1 fields. I have a data
access page that has a submit command button (that should open the data
access page in the desire record) and 2 dropdownlists: PNList1 (which display
the list of part numbers in the table) and ChangeList1 (which display the
list of changes done to the part number specified in the previous
dropdownlist). The query says:

SELECT FormTable1.PartNumber, FormTable1.Change1
FROM FormTable1
WHERE (FormTable1.PartNumber=PNList1.value) and
(FormTable1.Change1=ChangeList1.value);

Can I run the query in a script when clicking the submit button in the data
access page where I choose the part number and change, and then open the data
access page that displays the records? I really do not know if this is
possible. I am really thankful for the help you can give me. If you have any
suggestion of how to do this, will be really appreciated. :)
 
Z

Zulay

Is there a way in which I can see a specific record from an Microsoft Access
data base in a data access page? Please advice.
 

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