473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Why default value might not be working?

MLH
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?
May 21 '07 #1
3 5089
MLH
Oops... the name of the textbox control on the form is Text106 -

not Rev. (sorry)
May 21 '07 #2
MLH
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
MLH
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: ago | last post by:
Is it possible to have a default value associated python objects? I.e. to flag an attribute in such a way that the assignment operator for the object returns the default attribute instead of the...
3
by: Dev | last post by:
Hello all, I am working on setting up a table that will append a sequence to the end of the value inserted. Example; INSERT INTO test (test) VALUES ('abcd'); And have the data in the database...
3
by: Ian D | last post by:
Firstly apologies for the convoluted question. I found this problem whilst building a larger database. I've distilled it down to as small as possible and can send a 200k example to anyone who has...
3
by: Todd D. Levy | last post by:
I have a number of Drop Down Combo Boxes where users select a country; 99% of the time the selection will be "United States". I want to use VBA code in the New Record Event to populate this field...
10
by: Brad Baker | last post by:
I have an asp.net/csharp application that requires a particular variable to work properly. This variable is usually passed via a query string in the URL when the application is first run but under...
4
by: rczuba | last post by:
Problem: Creating a Default Value for a field in a subform when a field in the subform & form match. I'm trying to create a payroll database for a small home business that I have that has had...
1
by: EJO | last post by:
I've looked around the groups and don't have tried some of the various suggestions to no avail. So I'm hoping someone can help me out here. I have a form that, when a cmd button is clicked,...
9
by: lawpoop | last post by:
I'm trying to write some simple code, but I might be simplifying it too much. I have a function that either returns a string that I want, or FALSE. In the code that I'm working on, I would like...
7
by: hannoudw | last post by:
Hi I'm working on the invoice customer form and i had those text box : txtarticle, txtPrice, txtAfterDiscPrice, txtCashMoney i want to write this code If (txtAfterDiscPrice is null) then...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.