programmer defined data type (1 Viewer)

Status
Not open for further replies.

BadKitty

Registered User.
Local time
Today, 18:41
Joined
Jul 7, 2005
Messages
55
i am trying to create a data type for a table that includes a constant letter along with an autonumber (this will be the primary key for the table)...any suggestions? also, how do i add it as a data type in table design view? thanx!
 

modest

Registered User.
Local time
Today, 18:41
Joined
Jan 4, 2005
Messages
1,220
You have 3 options all depending on what you want to do:
1) have 2 fields - use one for the letter and the other for the autonumber
2) use one text field --> create your own autonumber function
3) if all your records are going to have the same letter... you dont need to store it, just use the autonumber field and add the letter in code when you need it
 
Last edited:

BadKitty

Registered User.
Local time
Today, 18:41
Joined
Jul 7, 2005
Messages
55
thanx for your suggestions. another question though...i need the letter to show in the forms that the users will be inputting data into (and yes, all the records will have the same letter for each table - i'm making 4 tables with 4 different letters), so how would i go about creating my own autonumber function & calling it when the form is opened? or if you think the 3rd option would be better, please clarify how i would go about doing that. thanx!
 

modest

Registered User.
Local time
Today, 18:41
Joined
Jan 4, 2005
Messages
1,220
if it's an autonumber... the user shouldn't be editing it.

Simple Workaround:
Have 2 textboxes... 1 that is the autonumber field of the table, the other is just a blank textbox

In the second textbox's default value property put:
= "A" & Me.txtAutoNumberTextBox.Value

"A" is the constant letter you want people to see
Make the autonumber textbox (the one linked to the table) hidden
 
Last edited:

ScottGem

Registered User.
Local time
Today, 18:41
Joined
Jun 20, 2005
Messages
1,119
Its not a good idea to post the same question in multiple forums. Please view the Answers in the General forum.
 
Status
Not open for further replies.

Users who are viewing this thread

Top Bottom