How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask NewITZone Your Own Question
NewITZone
NewITZone, Computer Enthusiast
Category: Microsoft Office
Satisfied Customers: 90
Experience:  I have been using Office Pro for 10 years and implemented applications for business use.
53509759
Type Your Microsoft Office Question Here...
NewITZone is online now
A new question is answered every 9 seconds

How to hide the initial characters in an Access ListBox? I

Customer Question

How to hide the initial characters in an Access ListBox?

I have an Access 2007 application.

In it, I have a number of personnel and training reports.

The personnel reports are named like this: (p) All Personnel; and the training reports are named like this: (t) All Training for All Members.

I have put this "(p) " prefix on all the personnel reports and this (t) " prefix for all the training reports.

I did this so I could distinguist each type of report so it could be selected to be displayed in it's own listbox.

I use this query, in the Row Source of the listbox, to only select the personnel reports.

SELECT [MsysObjects].[Name], [MsysObjects].[Name] FROM MsysObjects WHERE ((([MsysObjects].[Name]) Not Like "~*" And ([MsysObjects].[Name]) Not Like "MSys*") And (([MsysObjects].[Name]) Like "(p)*") And (([MsysObjects].[Type])=-32764)) ORDER BY [MsysObjects].[Name];

This query successfully selects all the personnel reports and displays them in the listbox.

My Problem

Now, when the personnel report is listed in the listbox, the report is displayed exactly as I named it, including the identifying prefix "(p) ", that I used to aid the selection process.

Obviously, I don't want the users to see the report listed with the prefix. I want to only display the report name without the prefix.

So, how do I not display the prefix in the listbox but keep it as the actual report name so I can use the prefix in my selection queries?

This is the way the report is displayed in the listbox now... (p) All Personnel.

I would just like it to read... All Personnel

I believe that the answer may involve a text manipulation expression that ignores the first 4 characters of the report name: open parentheses, t or p, closed parenthesis, and one space.

If so, what is the expression and exactly where do I put it in the query.

Or, maybe you have a better solution.

Thanks, John

Submitted: 5 years ago.
Category: Microsoft Office
Expert:  Lindie-mod replied 5 years ago.
Thank you for your patience, your business is very important to us, we are waiting on the Expert with the right expertise to come online. Feel free to let us know if you would like us to continue searching for an Expert or if you would like us to close your question. Thank you for your understanding!
Customer: replied 5 years ago.

I am sorry to trouble you but I have found the answer to my question by myself.

I have sent a request to customer service to find out how I can cancel my question and get a refund. This was my first question to JustAnswer.com.

This was the answer to my question.

SELECT Mid([MsysObjects].[Name],4) as CleanName, [MsysObjects].[Name]
FROM MsysObjects
WHERE ((([MsysObjects].[Name]) Not Like "~*"
And ([MsysObjects].[Name]) Not Like "MSys*")
And (([MsysObjects].[Name]) Like "(p)*")
And (([MsysObjects].[Type])=-32764))
ORDER BY [MsysObjects].[Name];

JohnF