how to create field in table that just get number?
how to create field in table that just get number?
Set the fields data type to Auto Number
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
You want to insert a number.
When?
How?
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
Perhaps you could give us a bit more about what exactly you are trying to do.
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
Try the following lines of code in the Before UpDate event of the text box in which the telephone number is entered.Code:If Not IsNumeric(Me.ActiveControl) Then Cancel = True MsgBox "Entry must be numeric" End If
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
From experience, a TelNo ( I'm reading this as telephone number) is really a text/string field. You don't do any arithmetic operations on a telNo -- eg my telNo +6
Whereas with an QuantityOnHand, you could do such arithmetic operations
eg QuantityOnHand = QuantityOnHand - QuantitySold
You can insert a string, and ensure that all characters are digits ( each char must be 0-9)
Do you want to allow - or ( or ) ?
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
You could set the Input Mask property for a field in a table, or for a text box on a form to #######
However, this would restrict the max number of digits entered to however many #s you have set.
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
I agree with Bob -- data gets entered into the table via a Form. Users have access to Forms - not tables directly.
how to use QuantityOnHand? can you put sampleFrom experience, a TelNo ( I'm reading this as telephone number) is really a text/string field. You don't do any arithmetic operations on a telNo -- eg my telNo +6
Whereas with an QuantityOnHand, you could do such arithmetic operations
eg QuantityOnHand = QuantityOnHand - QuantitySold
You can insert a string, and ensure that all characters are digits ( each char must be 0-9)
Do you want to allow - or ( or ) ?
What exactly are you having issues with?
When you create a table (MyTable),:
- you can name a field MyTelNo and assign it datatype Text.
-you can name a field MyQuantity and assign it datatype Number Integer
In a query you could enter some test data
In an Update query you could say
Update MyTable Set MyQuantity = MyQuantity + 100
which will update all records, and will update the current MyQuantity value with MyQuantity + 100