473,800 Members | 2,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.DoIt emID, tblDoItems.Titl e,
tblDoItems.Deta ils, tblDoItems.Done , tblDoItems.Prio rity,
tblDoItems.Entr yDate, IIf([Priority]=1,"High
Priority",IIf([Priority]=2,"Medium Priority","Low Priority")) AS
PriorityWord, tblDoItems.Proj Name, tblDoItems.Pic, tblDoItems.Rev
FROM tblDoItems
WHERE (((tblDoItems.P rojName)=GetPro jectName()))
ORDER BY tblDoItems.Prio rity;

I have a form named frmAdminDoListE ntryForm 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 5114
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
2423
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 object itself, but calls to other object attributes are properly resolved? (I don't think so, but I am not sure) Example: class obj(object): x=1 #assume x is somehow made into a default value
3
2155
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 be; abcd0001 Now I do have things setup else where were the default value for the field
3
3464
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 the time to have a play. Am I doing something silly or is this an Access problem (or other)? Access 2000 3 tables tblID contains ID (autonumber), Data (text) tbl1 contains ID (Number, default = nothing, Primary Key), bool1 (yes/no)
3
5331
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 with "United States" as the default value, but still allow the users to select another value (country) on those rare occasions where it applies. I just want to make sure that this code will not cause any conflicts with the normal functionality...
10
2523
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 certain circumstances the query string may not contain the variable. So I need some way of establishing a default value if one isn't set. Is there some way I can set a query string on page_load OR is there some way I can use a global variable...
4
2050
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 (and hopefully will continue to have) lots of growth. I have created a Transaction table to hold the hours, date, location of work (as the employees work at various locations), pay rate, and employee id. the employee id field has a one-to-many...
1
1828
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, changes the property of the form to dataentry. On this form, there are two fields that have a default value set. The one default value set using the property sheet is getting the value from a numeric field on a different form and is working just...
9
2951
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 to default to another string if the function returns false. Here's the long way to do it: $string = myFunction(2);
7
4071
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 txtCashMoney=txtPrice ; else txtCashMoney=txtAfterDiscPrice; on the default value of the txtCashMoney.
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10250
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.