Help Me Please(auto fill )

  • Thread starter Thread starter kashif
  • Start date Start date
K

kashif

Dears.
i want that when i put a data in field it automaticaly fill with
sign.For Example i put 2000 in the field.it put -2000.Thanks if an
body can help m
 
Kashif,

Probably you can put some code on the After Update event of the textbox
on the form where you enter the data in this field. For example...
Private Sub YourField_AfterUpdate()
Me.YourField = Me.YourField * -1
End Sub

Or, what do you want to happen if you enter -2000? Should it then
convert to 2000 or should it leave it as -2000 and only convert in the
case of a positive entry? If it should leave, then the code like this...
Private Sub YourField_AfterUpdate()
If Me.YourField > 0 Then
Me.YourField = Me.YourField * -1
End If
End Sub
 
Kashif

Given the example you offered, Steve's response handles numbers. Please
note that Steve's (and my) response is predicated on you using a form, and
NOT trying to do this directly in the table.

If what you are entering in the field is text, rather than a number, you'll
need to concatenate the special character ("-") to the text string with
something like:

Me!TextControlName = "-" & Me!TextControlName
 
Back
Top