Full Version: Editing Records with a Form
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
races23
I am working on a database for our stock of handheld terminals. I have created forms to add new stock, delete and view nstock but I am having problems with the edit form. Essentially I want to be able to choose the stock record from a combo box and pull that record to focus. There is only 2 fields that need editiing from there, location and status. At present all it seems to do is show me all the records in the combo box, which is fine, but it will only edit record number 1.

All help appreciated.

Steve..
GroverParkGeorge
Welcome to Utter Access.

You can create a "serarching" combo box that will set focus to the record selected. Use the Combo Box wizard to add a new, UNBOUND, combo box to the form. When the dialog box opens, select the third option, "Find a record...."

THen, when you select a record in that combo box, it will shift the form's focus to that record for editing.

You mention you already have a combo box on the form, so I'm curious if that is what it is supposed to do. And if so, why it does not appear to be working correctly.


HTH


George
races23
Hi George.

Thats how I created my combo box, although wizards are different in 2007, unbound and looks for the values in the table.

At present I have 5 test stock products in the table;
PDA1111
PDA2222
PDA3333
PDA4444
PDA5555

These are all displayed in the combo box, but when selected I notice the record select at the botoom stays on record 1 no matter which record is selected thus only editing record number 1.

Thanks
Aquadevel
Races23,

What is the code you have in the combo-box's 'After-Update' event?
races23
As I have no sql knowledge I dont have any in there.
Essentially Access forms allow you to control your database in a friendly way, why would you need to use code for a basic task of editing a record..?

If it has to be code then please can you supply it so I can use it.

Thanks
mike60smart
Hi

If you have a ComboBox that is looking up a list of stock products - when you select a product from the list it should store the ID Nr for that product in the underlying table.

If you move of that Record to the Next or a New record then you are able to choose the same or a different item from the StockProducts ComboBox

Is this how you have your Form set?

Mike
Aquadevel
Races23,

If you have code like the following in your combo's After-update' event:

Dim rst As Object
Set rst = Me.RecordsetClone
rst.FindFirst "[NameOfYourStockProductsFieldHere] = '" & Me.Combo67.Column(2) & "'" <~ change 'Combo67' to yours
Me.Bookmark = rst.Bookmark
Me.Section(0).Visible = True
Set rst = Nothing

You would select one of the 5 test stock product numbers from the combo, and it would then
goto and show you that records data.

unless I'm missing something. sad.gif

Good luck,



Edited by: Aquadevel on Sun Apr 6 18:36:04 EDT 2008.
races23
Thanks for your repliies.

Its still not having the desired effect, maybe I have changed one to manys settings...can you confirm the property sheet settings for the combo box please..?

Thanks
races23
Do I presume from the lack of replies that access can not do this or no one understands what I am trying to do..??
jurotek
Hi,
Here's example how it's done. See ATT.
races23
Jurotek.

Its as simple as that! lol
Thank you very much I really appreciate that.

You would think Access would have a wizard for that.

Thanks again.
jurotek
YW,
Glad we could help
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.