Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 17th, 2004, 05:03 PM
Rishyraj Rishyraj is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 53 Rishyraj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 29 m
Reputation Power: 5
Smile How to set a default value for a field in a form

Hi,

I have two amount fields in a form, If i type in one, i want it to reflect in the other amt field, with the ability to edit the second one, with out effecting the first amt field.

Any suggestions please.

Thank you

Rishy

Reply With Quote
  #2  
Old November 17th, 2004, 05:21 PM
smartbs smartbs is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Location: Michigan
Posts: 7 smartbs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Use the onchange event or similar on the first field. Then attach code like this to the onchange event:

Me.text2 = me.text1.text

smartbs
www.accessneeds.com

Reply With Quote
  #3  
Old November 17th, 2004, 09:30 PM
Rishyraj Rishyraj is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 53 Rishyraj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 29 m
Reputation Power: 5
Thank you....but

I tried using the onchange event.. i typed Me.Text0 = me.text2.text, it gives me run time error 2185. It gives a message, you cannot reference a property or a method for a control unless the contrl has a focus.

Please Advise.

Thank you

Rishy








Quote:
Originally Posted by smartbs
Use the onchange event or similar on the first field. Then attach code like this to the onchange event:

Me.text2 = me.text1.text

smartbs
www.accessneeds.com

Reply With Quote
  #4  
Old November 18th, 2004, 01:37 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
Rishy,

Use this

Text2.Value = Text1.Text

Text1 is where you type in your text.

Me refers to the control with the focus. You can use this in either the OnChange or AfterUpdate events

lwells

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > How to set a default value for a field in a form


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT