I have a table named tblDoItems. It has a text field named
[Rev]. There is no default value property setting at the table
level. I have a query named qryAdminDoList based solely on
the table that looks like this:
SELECT DISTINCTROW tblDoItems.DoItemID, tblDoItems.Title,
tblDoItems.Details, tblDoItems.Done, tblDoItems.Priority,
tblDoItems.EntryDate, IIf([Priority]=1,"High
Priority",IIf([Priority]=2,"Medium Priority","Low Priority")) AS
PriorityWord, tblDoItems.ProjName, tblDoItems.Pic, tblDoItems.Rev
FROM tblDoItems
WHERE (((tblDoItems.ProjName)=GetProjectName()))
ORDER BY tblDoItems.Priority;
I have a form named frmAdminDoListEntryForm whose recordsourc
is the above named query. It has a textbox control named Rev whose
controlsource property is the field named [Rev]. I have a defaultvalue
setting on that control. I entered =GetCurrentRev() there. That
FN is in a global module. Here it is:
Function GetCurrentRev() As String
GetCurrentRev = MY_VERSION$
End Function
Typing ? GetCurrentRev() in the debug window prints the value
currently assigned to MY_VERSION$ global var.
When I open the form, #Name? is what displays in the textbox.
I don't know why. When I go to new record in that form, the desired
default value is NOT displaying in that form's control as I expected.
Is there something about the query, perhaps, that is preventing the
default value from being used when adding a new record with this
form?