I renamed my fields DNumber for day and MName for name of month
MY goal is to fill in this type of sentence on a legal form using the
input from my user interface in access 2000 and automating the
document in word 2000 to fill in the blanks and print the doc
"on this the __________ day of _________________ blah blah blah"
I put the controls on the form and using the expression builder -
I chose functions, built-in functions, date/time, and day and month
this is what is returned to the control source for these controls
= Day («number»)
= Month («number»)
When I open the form, both controls show this ?Name
Here is the sql statement from the query that the table is built on,
including these two controls.
SELECT tblEmpContactInfo.EmpID, tblEmpContactInfo.FName,
tblEmpContactInfo.Midinit, tblEmpContactInfo.LName, [LName] & ", " &
[FName] & " " & [Midinit] & "." AS LFMName, [FName] & " " & [Midinit]
& ". " & [LName] AS FullName2, [FName] & " " & [Midinit] & ". " &
[LName] AS FullName, [FName] & " " & [Midinit] & "." AS FNameMidInit,
[City] & ", " & [State] & " " & [Zip] AS CityStateZip,
tblEmpContactInfo.Street1, tblEmpContactInfo.City,
tblEmpContactInfo.Street2, tblEmpContactInfo.Apt_Suite,
tblEmpContactInfo.State, tblEmpContactInfo.Zip, tblEmpContactInfo.DOB,
tblEmpContactInfo.SSN, tblEmpContactInfo.HomePhone,
tblEmpContactInfo.WorkPhone, tblEmpContactInfo.DOB,
tblEmpContactInfo.StartDate2, tblEmpContactInfo.StartDate,
tblEmpContactInfo.AnnivDate, tblEmpContactInfo.ZNumber,
tblEmpContactInfo.WPosition, tblEmpContactInfo.StartPayRate,
tblEmpContactInfo.MaritalStatus, tblEmpContactInfo.StOfRes,
tblEmpContactInfo.Gender, tblEmpContactInfo.HrsWorked,
tblEmpContactInfo.[Instructions 1], tblEmpContactInfo.[Instructions
2], tblEmpContactInfo.[Instructions 3], tblEmpContactInfo.Note1,
tblEmpContactInfo.Dnumber, tblEmpContactInfo.MName
FROM tblEmpContactInfo;
Actually, I would really like to know what to use as 'criteria' on the
fields in the query used to build the table.
Thanks for your help Ken. I really appreciate it
Ken said:
Ahhhh, part of your problem may be that you are being bitten by the use of
Reserved Words as the names of fields. Day and Month are the names of VBA
functions; if you use them as control or field names, you must always put
[ ] characters around them when using them as field names. Better, much
better, to never use them at all as control or field names.
See KB article number 286335 for more info:
ACC2002: Reserved Words in Microsoft Access
http://support.microsoft.com/default.aspx?scid=kb;en-us;286335
Second, if Day and Month are field names, then you cannot "invoke" them by
using the VBA functions with the same names. Your form is completely
confused because your expression tells it to go get a function named Day,
but it sees a field named Day, and doesn't know what you want done.
Post the SQL of the form's Record Source query and let's start with it to
help you past this difficulty.
Also provide more details about the data that the query returns and about
what you're wanting to show on the form.