Add asterisks to a field automatically.

ktariske

Registered User.
Local time
Today, 15:25
Joined
Jun 12, 2002
Messages
31
Hello. First off I want to thank everyone who uses these forums. It's great and I usually get an answer and support questions on a regular basis.

Question: I have a table that has a key number field. I also need to use that same number in other field and add an *-asterisk before and after that number for the value. It's for bar code scanning on a form/report, but the bar code font requires an asterisk before the number and after. Any ideas.?
 
Is this just for reporting or do you actually need the * in the field? Either way you could set up a new field in a query and do this:

NewField: "*" & [YourField] & "*"

If you need to do it at data entry time you could do the same thing using an event as the trigger. Here is an example.

Private Sub YourField_Exit(Cancel As Integer)
Me.YourField2 = "*" & [YourField] & "*"
End Sub

Hope that helps. Post back if you have more questions.
 
Last edited:
Another quick question.

No the asterisks can be added later, so I just put them in a qry and run the qry?
 
Yup. Create a new query for the table that holds the field you want to use. Then go into design view. Once there just go to the first blank column and add the NewField: "*" & [YourField] & "*" to the top row.

NewField is the name of the field that will be created in your query and YourField should be replaced with the field that holds your data.

Thats it. Open your query and the new fields with the astericks will be created "dynamicaly." All that is left to do is base your report off the query instead of the table and set the source to the newly created field.
 
Last edited:
Again, this site rocks.

I've never seen such a current and accurate forum. 5 stars, 5 stars.

That answered all my questions. I think I might hang around on this Internet a while longer. Besides it's my second lap.

Peace and thanks.
 
Another quick question.

Ok, so that updates a new field within the query. Can I link that back to the table somehow, or do I just copy the row into the table. It only needs to be done once or twice a month.

Thanks
 

Users who are viewing this thread

Back
Top Bottom