473,549 Members | 2,862 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting DefaultValue Property

How do I write the following code to set the default value?

Me!xNum.Default Value =
Me!XCurrency.De faultValue =
Me!XDate.Defaul tValue =
Me!XString.Defa ultValue =

Can I just put all the lines of code in the Form's AfterUpdate event?

Thanks!

Mark
Nov 12 '05 #1
1 1949
Yes, you can, but bear in mind that the DefaultValue property is a string:

Me!xNum.Default Value = """" & 999 & """"
Me.XDate.Defaul tValue = """" & Format(Date, "Short Date") & """"
Me.XString.Defa ultValue = """Type over this nonsense"""

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Mark" <mm*****@earthl ink.net> wrote in message
news:Eu******** *******@newsrea d2.news.atl.ear thlink.net...
How do I write the following code to set the default value?

Me!xNum.Default Value =
Me!XCurrency.De faultValue =
Me!XDate.Defaul tValue =
Me!XString.Defa ultValue =

Can I just put all the lines of code in the Form's AfterUpdate event?

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
2729
by: MLH | last post by:
I have an A97 table with a Yes/No field named TowJob and a form bound to that table. The TowJob control on the form is bound to the same field. It is an option group with Yes and No bttns valued at -1 and 0 respectively. Unless I specifically set the table field's defaultvalue to Null, the form comes up with an automatic value of 0 in the...
18
18328
by: Dixie | last post by:
Can I set the Format property in a date/time field in code? Can I set the Input Mask in a date/time field in code? Can I set the Format of a Yes/No field to Checkbox in code? I am working on a remote update of tables and fields and can't find enough information on these things. Also, how do you index a field in code?
2
11440
by: timtos | last post by:
I want to set a color property of a user control by default. I am doing it like this: .... DefaultValue(typeof(System.Drawing.Color), "Blue"), .... The compiler likes it but my program ignores it! I´ve also tried other things like:
7
20754
by: charliewest | last post by:
Using .Net CF, i have created a 2 dimension ArrayList, and "binded" this list to a ComboBox control using the "DataSource" property. I have set the DisplaySource and ValueMember properties as well. The control populates well, both the display values, and selected values. However, when i try to "set" the SelectedValue or SelectedIndex...
1
1471
by: RR | last post by:
Hi, I want to set the defaultvalue of a property in a class. I know this is possible by the DefaultValue Attribute like this: public class Test { public Test(){}
1
1043
by: Cesar Ronchese | last post by:
Hi all. I need to set a default value to my UserControl, but I'm getting a error when trying reset the value via PropertyGrid on the host IDE: "Object type cannot be converted to target type". The value I'm wanting to set came from a enum value. See the code sample: <DefaultValue(NavigationDirectionEnum.Down)> _
6
2511
by: MLH | last post by:
I have a form named frmVehicleEntryForm. It has a 3-tab tab control. On the 2nd tab page, there's a textbox named VehicleLocationName whose default value setting is =DLookUp("","tblAdmin","=Forms!frmVehicleEntryForm!TowCoDropDownBox") The criteria of the DLookUp points to a control on tab page 1. If, after choosing a company in...
5
8319
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi guys I have the following AccessDataSource control on my page.. <asp:AccessDataSource ID="adsAllStories" runat="server" DataFile="~/App_Data/Stories.mdb" SelectCommand="SELECT StoryID, StoryTitle FROM Stories WHERE StoryTitle LIKE '?%' ORDER BY StoryID DESC"> <SelectParameters> <asp:Parameter Type="char" DefaultValue="A"...
3
8431
by: Johnny Jörgensen | last post by:
Does anybody know how to correctly specify the defaultvalue attribute for a property whose type is an enum. Example: Public Enum TestValues Value1=1 Value2=2 End Enum
0
7446
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...
0
7715
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7469
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...
0
7808
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...
0
6040
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...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5087
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...
0
3498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1935
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

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.