BrettM
just a pert, "ex" to come
- Local time
- Today, 14:55
- Joined
- Apr 30, 2008
- Messages
- 134
Hi again guys,
I have a simple form linked to a table.
The table has 3 fields - ID, Name, Value.
The form has two Text Boxes - one for Name and one for Value.
It also has a List Box which has 3 columns - Name, Value and ID, bound to column 1.
I have set up the List Box using the "Find a record on my form" wizard and it works well. If I click on any line in the List Box then the two Text Boxes are updated with the correct data.
The List Box AfterUpdate has...
I would like to have the List Box show the current record when using the forms navigation buttons. I can achieve this by setting the List Box's control source to "Name" and removing the AfterUpdate code. This also works well.
Here is the quandary...
Having both the control source AND the After Update running at the same time causes some weird stuff. If you have the current record at say the 5th and click on the 3rd record in the List Box, suddenly the name of the 3rd record becomes the name of the 5th. Click around a few more times and everything is truly messed up.
Do you have any suggestions as to how to have this List Box being able to display the current record AND act as a record selector? I can make it do either but not both.
Thanks
Brett
I have a simple form linked to a table.
The table has 3 fields - ID, Name, Value.
The form has two Text Boxes - one for Name and one for Value.
It also has a List Box which has 3 columns - Name, Value and ID, bound to column 1.
I have set up the List Box using the "Find a record on my form" wizard and it works well. If I click on any line in the List Box then the two Text Boxes are updated with the correct data.
The List Box AfterUpdate has...
Code:
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "Name = '" & Me.ListBox1 & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
I would like to have the List Box show the current record when using the forms navigation buttons. I can achieve this by setting the List Box's control source to "Name" and removing the AfterUpdate code. This also works well.
Here is the quandary...
Having both the control source AND the After Update running at the same time causes some weird stuff. If you have the current record at say the 5th and click on the 3rd record in the List Box, suddenly the name of the 3rd record becomes the name of the 5th. Click around a few more times and everything is truly messed up.
Do you have any suggestions as to how to have this List Box being able to display the current record AND act as a record selector? I can make it do either but not both.
Thanks
Brett