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 June 7th, 2006, 10:34 AM
aaron_v aaron_v is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 6 aaron_v User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 5 m 52 sec
Reputation Power: 0
Question If Then to change control value on Parent Form

I need some help. I am working with an order form (frmProcessUnfilledOrders) which has an item detail subform. The subform contains a text control for "backordered quantity". I want to create a test with an IF THEN that if any item on the subform has the backordered control set to a value other than 0, then change the "order status" option group control value on the parent order form to "3".

I have created my IF THEN in the Changed event for the Backordered control. I realize this is probably really bad code, but here it is:

Private Sub txtBackordered_Change()

Dim numBOValue As Integer
Dim numStatus As Integer

numBOValue = txtBackordered.Value

If numBOValue > 0 Then
numStatus = 3
DoCmd.GoToControl (frmProcessUnfilledOrders.frameOrderStatus)
frameOrderStatus.Value = numStatus

End If

End Sub

I get no runtime error, but it does not effect the parent form control at all.

Thanks for helping a beginner out of a hole!

Aaron

Reply With Quote
  #2  
Old June 7th, 2006, 08:42 PM
Clarafication Clarafication is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 23 Clarafication User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 5 m 10 sec
Reputation Power: 0
I would run this in the After Update of the field on the subform.

Private Sub txtBackordered_AfterUpdate()

If Me.txtBackordered > 0 Then
Forms!frmProcessUnfilledOrders!frameOrderStatus= 3
End If

End Sub

It won't change until you move out of the Backordered field, but this works when I try it.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > If Then to change control value on Parent 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 6 hosted by Hostway
Stay green...Green IT