Solved Records with a Dash don't display

NearImpossible

Registered User.
Local time
Yesterday, 18:20
Joined
Jul 12, 2019
Messages
225
I have this database that i've been work with for a few years now and it has grown into a beast thanks to help from several of you, but now I am running into an issue I haven't come across yet.

Basically most of the database is filterable by a Facility Name, however today I encountered our first Facility with a dash in its name, i.e. Facility-Name and when I open a form filtered on the Facility Name, it is blank.

I did a test and removed the dash from the name and it then populated the form, so my question is, how can I make this work with the dash in the name as it is required to be there?

Please advise

thank you
 
How exactly are you filtering the form?
 
Code:
DoCmd.OpenForm "FacilitySetupChecklist", , , "[Facility Name]= '" & Me![Facility Name] & "'"
 
Code:
DoCmd.OpenForm "FacilitySetupChecklist", , , "[Facility Name]= '" & Me![Facility Name] & "'"
What happens if you do it this way?
Code:
DoCmd.OpenForm "FacilitySetupChecklist", , , "[Facility Name]='Facility-Name'"
 
What happens if you do it this way?
Code:
DoCmd.OpenForm "FacilitySetupChecklist", , , "[Facility Name]='Facility-Name'"

are you saying to type in the actual facility name after the = ?

If so, that did bring up the record
 
Last edited:
are you saying to type in the actual facility name after the = ?

If so, that did bring up the record
Okay, if that worked, then the problem probably had nothing to do with the dash character. It must have something to do with your form's data (you know, whatever is in Me![Facility Name]).
 
Okay, if that worked, then the problem probably had nothing to do with the dash character. It must have something to do with your form's data (you know, whatever is in Me![Facility Name]).

not sure, but changed the code back to the original and its working with all facilities, dash or not, gotta love DBs....
 
not sure, but changed the code back to the original and its working with all facilities, dash or not, gotta love DBs....
Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom