Full Version: Record selectors
UtterAccess Forums > Microsoft® Access > Access Forms
Lee01
Greetings all!
I'm new here but I do belong to many technical forums. I've used Access 97 for about 7 years but I need some help. I must apologize if this answer exists somewhere in the forum.
I have created a simple database for tracking customers. It is relational database but I have created a Customer Number field in the "Customer" table. I placed it on the "Customer" form and I wish to link it to the RECORD SELECTOR of the form itself. (Please, I wasn't yelling) Does anyone know how this is done? In other words, as I advance through the record selectors, I would like the Customer Number field to be the same as the record selector number. I have used the following in the code section:

Private Sub CustomerNumber_Change()
End Sub
Many thanks for your help folks.......Lee
R. Hicks
Welcome to Utter Access Forums ... frown.gif

You posted:

This makes no sense .. as the record number is not a static value ...
The record number is dependant on any filtering and sorting that may be applied to the recordset.
You may need to rethink what you re doing and come with another solution .. such as using code to create a unique incremented number to assign as the customer number ...

RDH
niesz
Lee,
Welcome to UA! You will soon forget about all those other forums, as this is the best Access Forum there is, hands down.
About your question...are you saying you want the CustomerID to match the current record number? (See attached) If so, this should not be done. As the order of your records will certainly change and then your records will not be in sync. Also records could be deleted, also throwing off your match.
Lee01
Many thanks for your quick responses guys! I just sold a business where the database developer did have a field called CustomerID and it was in sync with the record selectors. If a record was deleted, the actual record contained no data but still existed as a "blank" record, thus not throwing the record selectors out of wack, as it were. Does this clarify my question any better? Thanks for your patience......Lee
niesz
Not really. Unless this was a custom record selector, it would not be wise to do this. What if you want to reorder the records? Did you look at the screenshot? I just want to confirm that we're talking apples to apples.
R. Hicks
Nope ... this does not make what you want to do any more correct.
The record number should have absolutely no relationship to the customer number ...
Also .. there should never be any blank empty records in a table ...

RDH
Edited by: R. Hicks on Fri Dec 16 22:02:16 EST 2005.
niesz
>
LOL. Ricky, I think you may have mistyped...
R. Hicks
You are mistaken ... it says:
You caught me before I could "proof read it" ...
Thank goodness for the edit reply button .. <g>

RDH
Lee01
Hi again guys. The screen shot is correct, Niesz. Perhaps the developer did create a custom record selector. The CustomerID field in the CUSTOMER table is a NUMBER data type, indexed (duplicates not allowed). It is not an active field on the FORM. It simply mimcs the record number. At any rate, what I'm wanting to accomplish is to put a phone number sub-form on the main form and link the CHILD and MASTER fields with the CustomerID field so as to keep the phone number(s) linked to that paticular record. To acheive this, should I alter the CustomerID field in the CUSTOMER table to an autonumber attribute? thanks again fellows....... lightbulb.gif..Lee
niesz
Yes. The CustomerID should be an Autonumber field. It should have no correlation to what record you are on. It should be internal to the DB itself. Then, in the PhoneNumber table, there should be a 'CustomerID' - Long Integer - FK back to the CustomerID in the Customers table.
When your Child and Master relationship will work as expected.
Lee01
Thanks Niesz!! It worked. I don't know how the developer did it before but it doesn't matter. Your suggestion worked. Thanks to all. I'll likley be back with more stuff later. All the best....Lee
niesz
Glad to help...we never close.
Aquadevel
I like 'thinking' of the PK number and the Record Number as something Access 'need's', but we should never play with nor really use. Other then maybe displaying on a form.
nyway, Thats my 2 1/2 cents worth. frown.gif
Aqua
Aquadevel
Just want to add to Nie's post.
This is 'more' then hand's down the best Access Forum on the net.
You ask a question, you will get an answer.
Yea, you have to do the legwork in coding, but no one ever said anyone would do it for you.
Ostarted with Access 1.0/1.1 but normally just 'only modified" original app's until last year.
<I can never remember names in real life , or on the 'net', so again to all that have helped me get back into Access deeper this past year ~ THANK YOU!>
So, thats my 2 1/2 cents worth,
<~~~Trying to <stay @ least 1/2 cent above Jack, frown.gif>
Aqua
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.