Help Me Please(auto fill )

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
 
S

Steve Schapel

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
 
J

Jeff Boyce

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top