PDA

View Full Version : [SOLVED:] How to create a static negation sign (-) in a textbox



technocraze
01-30-2007, 07:06 AM
Hi community experts,

Environment
MS Acess, visual basic
May i knw whether is there a way to create a static negation sign (-) in a textbox? Is that a possiblity that this can be done using expression builder or code wise. If so hw it be achieve? It mean that whenever the form is being loaded, the negation sign will be there and it mux be static. tks

OBP
01-30-2007, 07:49 AM
technocraze, I do not know what you mean by "must be static"?

Is your other post solved now?

technocraze
01-30-2007, 09:23 AM
Once again tks for yr follow-up. The others have been resolved except the one that type mismatch error and the current issue. What i mean by static negation sign is the negative sign displayed in the textbox mux be fixed upon the form load event and user cannot change that sign.

OBP
01-31-2007, 07:30 AM
If the field is to accept a numeric value then you can enforce a negative value by placing <0 in the Field's Data Validation property.
You can have an enforced "-" sign in the field using the Field's Data Input mask, but that does not make the entered value in to a negative value.
You can in the Field's After Update event procedure enter
if me.fieldname > 0 then me.fieldname = 0 - me.fieldname
where fieldname is the name of your field.
Now whatever + value gets entered they are automatically converted to a negative value.