Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

character check 2

Status
Not open for further replies.

hoofit

Technical User
Nov 20, 2005
343
US
I have a field where the only acceptable entries are "Hours" or "Miles", users choice. How can I control this? Something like this but I'm stuck.

If characterCheck2 Like "*[hours]*" or "*[Miles}*" Then...
else...


Thank you,

hoof


 
How are ya hoofit . . .

Your complicating things for yourself. Why not just have a field for miles and one for hours? ... fast simple and easy on the logic.

If you must, then you to need a way to tell the difference (what your asking for). Best I can think of is to postfix a character like [blue]100m[/blue] or [blue]12h[/blue]. But this turns the field from numeric to string ... not a good idea if your summing.

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Probably need to provide more information. It may be two fields: value and units. Value field holds a numeric value, and the units field holds the type of units: "Hours", "Miles"

(the actual field names would be different since value is a reserved word.)
 
Yes there are 2 fields, one holding the numeric value and the other being the unit of measure, hours or miles. So text entered into the unit of measure would need to be an exact match of either hours or miles or it's not accepted. I suppose a radio button could be used but I'd like to explore this avenue first
 
hoofit . . .

How about a single column combobox with a value list of [blue]"Hours";"Miles"[/blue]?

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
AceMan1
Due to the arrangement of the my tables, I would need major reconstruction. Although that is a great idea, and simple.

You mentioned..... Best I can think of is to postfix a character like 100m or 12h. But this turns the field from numeric to string ... not a good idea if your summing.

This field is a text field (hours or miles) so there will be no summing.

What do you mean by postfix.

hoof
 
This would have absolutely nothing to do with your tables. Just change the textbox to a combobox and set the rowsource to Miles;Hours and call it a day.
 
OK, I changed to a combo box. The properties note row source type = Table/Query. Row source was empty so I changed it to read miles;hours. I get an error noting that the record source does not exist. I must be missing something.

Thank you
 
hoofit . . .

Properties of the combobox should be:

[tt]Column Count [blue]1[/blue]
Control Source [blue]your fieldname[/blue]
Row Source Type [blue]Value List[/blue]
Row Source [blue]Hours;Miles[/blue]
Bound Column [blue]1[/blue][/tt]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
AceMan1,
Gotcha, Thanx guys, this'll do the trick.

hoof
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top