473,395 Members | 1,440 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,395 software developers and data experts.

Setting DefaultValue Property

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

Me!xNum.DefaultValue =
Me!XCurrency.DefaultValue =
Me!XDate.DefaultValue =
Me!XString.DefaultValue =

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

Thanks!

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

Me!xNum.DefaultValue = """" & 999 & """"
Me.XDate.DefaultValue = """" & Format(Date, "Short Date") & """"
Me.XString.DefaultValue = """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*****@earthlink.net> wrote in message
news:Eu***************@newsread2.news.atl.earthlin k.net...
How do I write the following code to set the default value?

Me!xNum.DefaultValue =
Me!XCurrency.DefaultValue =
Me!XDate.DefaultValue =
Me!XString.DefaultValue =

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
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...
18
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...
2
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...
7
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....
1
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
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". ...
6
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 ...
5
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,...
3
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
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
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...

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.