Can I use combo box list out my record with going to the current record ??

alexkong2003

Registered User.
Local time
Today, 14:35
Joined
Sep 4, 2006
Messages
95
Hi all,

Another problem bothering me. Wish someone can help me to solve it. I am doing the 'Edit' Option right now ... As a user friendly propuse, I had try to use a combo box to let user to choose my employee record with all the detail on but the problem is the program 'JUST' list the record they can not go to the current record!! When i try to edit my record, the program is not allow (for sure because they can't have a duplicate record on it). The reason is because the record just stay in the FIRST record but can not go to the current record. I do believe is the problem of i using the way of listing the record as below:
Me.EmployeeName = Me.EmployeeName.Column(0)
Me.IC = Me.EmployeeName.Column(1)
Me.Nationality = Me.EmployeeName.Column(2)
Me.Race = Me.EmployeeName.Column(3)
Me.Sex = Me.EmployeeName.Column(4)
Me.FMU = Me.EmployeeName.Column(5)
Me.Position = Me.EmployeeName.Column(6)
Me.SectionField = Me.EmployeeName.Column(7)
Me.DOEmploment = Me.EmployeeName.Column(8)
Me.DOResign = Me.EmployeeName.Column(9)
Me.Remarks = Me.EmployeeName.Column(10)

So, Could someone help me to solve it like when i can use the combo box to select the Employee record with the details are on as the same time can go to current record... Thanks alot!!!

i do have the confident if i can go to the current record then my edit option can be working properly.

P/S: I had attach the picture... showing my program problem (with the red circle)
 

Attachments

  • 1.jpg
    1.jpg
    34.8 KB · Views: 200
anyone pls give me a hand i am really stuck over there for a week already....

Thank you for for the one who help is appreciate time & time again.~~
 
Hi Alex,
How come you are not using a bound form to a query that includes whatever you have as a RowSource for that ComboBox? Access will do all of that work for you.
 
Thanks for the reply ruralguy~~~ I do use the query to setup my combo box to select the employee name base on the query table but it won't show out the details unless i use the way above (do u have any good sugestion?) and the record is not going to the current employee name field in the table... so i can not do the editing. (The Duplicate error will be appear.)

As you say "using a bound form to a query that includes whatever you have as a RowSource for that ComboBox", can u just show me a really simple example because i actually don't know how to do that... Thank you...
 
Can you zip up your db and post it? Remove or obfuscate any sensitive data.
 
Thanks RuralGuy~~~~ I am really appreciate for your help!!!

here i attach the file to u ....
 
Last edited:
I changed your EmployeeName control to a textbox and added a ComboBox to look up employees and move to that record. I strongly recommend you use AutoNumbers as Primary Keys rather than the name and that you split out the name to several fields like FirstName, MiddleName, LastName etc. Putting them together for display is easy. Taking them apart later can be a real chore. I deleted the "Save" button since Access will save if anything is changed. You may want an "Oops" button with Me.UnDo to restore if something was changed in error. Once you move to another record the restore is no longer available.
 

Attachments

My gODDDD!!! U r incredible Rural!!! Billion Thanks to u my friend!!!! Actually i do download the code that look like the one u giving me, i had put it in my combo box but it not work because i don't really understand the definition of these code like recordset, recordsetclone, Me, Bookmark, whatever~~~ so by now i will try to study those code, it realllllyyyy useful!!!! Anyway Billion Thanks again because solve my problem !!!! Thanks Thanks Thanks!!!! (I will try to put the autonumber as my primary key as u say)

P/S Last thing~ do u have any great site that can give those beginner programmer to know or realise those complicated code easily?

Regard,
alex
 
You are certainly welcome my friend. As for a particular web site, I would recommend downloading as many free db's as you can and studying the code until you understand it. There are also some excellent books on the subject. Most forums have a must read list somewhere. I'm pretty sure this one does. Here's a link to it!
 

Users who are viewing this thread

Back
Top Bottom