?
Solved

Tag Property in Access

Posted on 2015-02-20
9
Medium Priority
?
234 Views
Last Modified: 2015-02-20
How do you allow 2 tags in the tag property . One tag is "Required" and I also need "Audit" tried semicolon and comma but that negates both
0
Comment
Question by:Spikemom
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 48

Accepted Solution

by:
Dale Fye earned 750 total points
ID: 40621398
you could do both, but then the code that checks for that value will have to use something like the instr() function to test for those values:

if instr(me.txt_SomeControl.Tag, "Required") > 0 then
   'do something
ELSEIF instr(me.txt_SomeControl.tag, "Audit") > 0 then
   do something else
endif
0
 
LVL 15

Assisted Solution

by:Berkson Wein
Berkson Wein earned 750 total points
ID: 40621400
The tag property is singular unfortunately.  It's just a single string.  I don't know how you're using the tag, but you might use a tag like
RequiredAudit
to indicat to your functions that this essentially has two properties.  You'd need to test for it something like this rough concept code:

If Field.tag = "Required" or Left(Field.Tag,length("Required")="Required") then
    do whateer
end if
If Field.tag = "Audit" or RIGHT(Field.Tag,5)="Audit") then
    do whateer
end if

Hope this helps.
0
 
LVL 15

Expert Comment

by:Berkson Wein
ID: 40621409
Dale and I posted the same basic code (at the same time), though I do prefer Dale's instr method over my rough code.  That way it doesn't matter if you have
RequiredAuth, Required;Auth, AuthRequired, Auth and Required
it'll catch it all.

Just remember that you're testing against a SINGLE string.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 15

Expert Comment

by:Berkson Wein
ID: 40621472
I'm sorry that you consider this only a "B" graded answer.  

Is there something that was unclear and that you need more help with?  I thought my explanation and algorithm along with Dale's excellent code should have been everything you needed.  Not only did you get an explanation of why the concept you were trying wasn't going to work (because you need to process the singular string field), but you were given the code to do it right.

In the future, please remember that the only thanks we get is your grade.  If there is something that's still unclear, feel free to continue asking until you're satisfied.  And if you can't get a complete answer, then feel free to grade less than an A.

-from an apparently overly-sensitive today expert on behalf of the rest of us.
0
 

Author Comment

by:Spikemom
ID: 40621483
Sorry I should have given you an A and will next time. Please forgive this time.  

Spikemom
0
 
LVL 15

Expert Comment

by:Berkson Wein
ID: 40621485
forgiven.  absolutely.
0
 
LVL 75
ID: 40621945
Keep in mind it's not that hard to accidentally blow out the content of the Tag property on the Control property sheet. If this happens, then you've got nothing. I've seen it happen. Same with hard coded Default Values at the Table or Form level.
Consider using a simple local table to store there sorts of 'tags' for a required field (et al), which can be read with a simple DLookup()  ... or initialize TempVars with these values on Form Load. TempVars remain in effect even if a 'reset' occurs which would clear regular variables.

mx
0
 
LVL 48

Expert Comment

by:Dale Fye
ID: 40621962
"blow out the content of the tag property"  ???

I use the Tag property all the time for things like "required", don't recall ever losing those values.
0
 
LVL 75
ID: 40622002
I would never use it. I'm a 'table driven' guy :-)
Much easier to maintain, update, discover, etc.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question