Comparing a text field in a table to textbox on a form.

PuddinPie

Registered User.
Local time
Yesterday, 16:37
Joined
Sep 15, 2010
Messages
149
Ok this should be easy but I’m going a little crazy because I can’t seem to figure it out and I’ve been looking everywhere for a working answer.

I have a table that has a date field set to text. I use the Mid function and get just the month in a query. I have a textbox on a form that when the user adds a month or removes a month from a selected listbox it adds or removes that months number from the textbox.

I want to us that text box on the form as the criteria for the month (the Mid function getting the month) and I can seem to get it to read what’s in the textbox and use it as the criteria. I can manually type in a number and it works fine.
 
It's the way the data is imported and because the BE is linked to a bounch of other databases I can change it without reworking every other database.
 
It's the way the data is imported and because the BE is linked to a bounch of other databases I can change it without reworking every other database.

The cDate() Function can be used to convert the String to a Date, as long as the String contains a date in a standard Date Format. Give it a try.
 
Is there a way of programming the text field so it will provide the variables with ‘or’ in-between them and not in just one long text string?
 
Is there a way of programming the text field so it will provide the variables with ‘or’ in-between them and not in just one long text string?

The previous advice was based on having a single Date per String. If there are multiple Dates, then another approach will be required. Perhaps if we can see the structure of the Text Field in question, we can have a better idea as to what approach might be better.

-- Rookie
 
I've made the date column so its mm/dd/yyy. The text string from the field should be sort able on multiple months.
ie. if the user chooses jan, feb and march the text box populates 01 02 03.
I would like to be able to find all 01, 02 and 03 months and have just them display with the proper language indicator which does work right now.
I'll attach the SQL from the query.

SELECT tblGWLCoe.*, tblGWLCoe.Lang AS [Language], GetEnglishDate(Date()) AS EnglishDate, French_Date(Date()) AS FrenchDate, tblGWLCoe.name AS Payee_Name, CDate(Mid([Annt1 Brith],5,2) & "/" & Mid([Annt1 Brith],7,2) & "/" & Left([Annt1 Brith],4)) AS Annt1DOB INTO tblTempGWLCOE
FROM tblGWLCoe
WHERE (((tblGWLCoe.Lang)=[forms]![frmLetterMenu]![cboLanguage]));

The text field I want to get the resaults from is [forms].[frmcompanymenu].[txtSelectedMonths].

Thank you for your continueing help.
 

Users who are viewing this thread

Back
Top Bottom