473,396 Members | 1,836 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Go to record in listbox

Hi!

On frmItems I have a two listboxes. The first, lstAllCategories, is
loaded with data from tblCategory when frmItems open. When user click
lstAllCategories, the lstSelectedItems will show all records for that
category.

Now when user clicks chosen item in lstSelectedItems, textboxes in
form will be filled and now user can edit the selected item.

However, I also have an Inputbox where user can enter an ItemNumber
and fill textboxes likewise.

So what I want is that lstSelectedItems will lookup the actual record
given in the inputbox that will fill textboxes, either by ItemID or
ItemName.

I've searched the group and think I've read that it is impossible to
have the cursor move and actually select the chosen record in the
textboxes.

Anybody that could give me a hint?

Me.Name
Nov 13 '05 #1
1 6634
Geir Baardsen wrote:
Hi!

On frmItems I have a two listboxes. The first, lstAllCategories, is
loaded with data from tblCategory when frmItems open. When user click
lstAllCategories, the lstSelectedItems will show all records for that
category.

Now when user clicks chosen item in lstSelectedItems, textboxes in
form will be filled and now user can edit the selected item.
By "textboxes will be filled", do you mean the form navigates to the
questioned record?
However, I also have an Inputbox where user can enter an ItemNumber
and fill textboxes likewise.

So what I want is that lstSelectedItems will lookup the actual record
given in the inputbox that will fill textboxes, either by ItemID or
ItemName.

I've searched the group and think I've read that it is impossible to
have the cursor move and actually select the chosen record in the
textboxes.


To find a record matching an entered value (air code, A97)

dim rs as recordset
set rs=me.recordsetclone
rs.findfirst "yourkeyfield=" & thatinputbox ' if it is a numerical value
'rs.findfirst "yourkeyfield='" & thatinputbox & "'" ' if it is a text
if rs.nomatch then
msgbox "That value doesn't occur in this table"
else
me.bookmark=rs.bookmark
endif
set rs=nothing

To navigate to a selected item in a listbox (must not be multiselect!),
you can do much the same; or, if the form happens to be based on the
same source as the listbox (you can ensure that with
me.recordsource=listbox.rowsource):

docmd.gotorecord , , acGoto,listboxname.listindex + 1

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: ChrisR | last post by:
Hi guys My app is a simple Main form with a few Subforms that are not linked, and a few pop forms. Problem is: I have a pop form with a Listbox with a list of records related to the...
5
by: Bob | last post by:
Hi Everybody I have a form called frmListBox that is connected to a table tblListBox. This is opened from a form called "frmInvoiceOrder" which has a subform called "zfrmInvoiceOrder" and...
1
by: SuffrinMick | last post by:
Hi All I have two tables: tblRecords and tblOptions. tblRecords consists of RecordID (autonumber), Record (text) and Option (text record of options chosen) fields tbloptions consists of...
3
by: Sarah Smith via AccessMonster.com | last post by:
I am creating a database of documents that need to be worked on, are int eh proress of being worked on, and have been completed. Sometimes the same document (an updated version) comes back for more...
6
by: MLH | last post by:
When the vehicle entry form (frmVehicleEntryForm) first opens, the additional owner SubForm control (frmAddnlOwnrListSubForm) is enabled. You can click on it and it will accept the focus. But after...
15
by: allansiu823 | last post by:
Hi I am new to MS Access and VBA and have been bothered by this problem for a looooong time. I have this listbox containing all the records (~1000) in a form and I want to be able to type something...
6
by: MarkoBBC | last post by:
Hi everyone, First a brief description of my form: I have a subform within a main form. In my subform, I have a listbox displaying address information by firm name. A user first has to select a...
1
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which...
2
by: lhsiber | last post by:
I am new to access and am having a problem with filtering. Here is a little bit of my setup: I have a main form that has a listbox so that users can choose one or many groups in which to display...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.