By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,706 Members | 1,305 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,706 IT Pros & Developers. It's quick & easy.

Why default value might not be working?

P: n/a
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
May 21 '07 #1
Share this Question
Share on Google+
3 Replies

P: n/a
Oops... the name of the textbox control on the form is Text106 -

not Rev. (sorry)
May 21 '07 #2

P: n/a
Also, it is worth mentioning that when I create a brand
NEW form based on the query and I drag ALL the fields
in the Field List over to the form, the control in question
on the form displays the desired default value when I go
to a new record. There are no problems associiatied with
that field at all.

Thix, to me, suggests that something is wrong with the
form I'm working with rather than the query.

I've been dealing with this for more than a year. I know
that must seem ridiclous. But it kicked my ass back then
and I gave up on it. Now that I'm back on the task, it's
still kicking my ass.
May 21 '07 #3

P: n/a
Who knows what the problem was?

All I know is after exporting to text and
rebuilding the form from scratch, all is
working now.
May 22 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.