Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Tag Property in Access

Posted on 2015-02-20
9
Medium Priority
?
275 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

636 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