If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Check button which zero outs a field

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-12-10, 10:15
marcusmacman marcusmacman is offline
Registered User
 
Join Date: Sep 2010
Location: UK
Posts: 119
Check button which zero outs a field

Hello again...nearly the weekend.

within my form I'm trying to create a check box which when selected writes a '0' to my price field, then makes visible a box saying 'Included'

It's a quotation database and sometimes we throw in items for free!!! and say it's included within the price.

Any ideas if it can be done?.

I've managed to get make a text box visible (wow you might say) but not managed to set the price field to zero.

cheers
marcus

Last edited by marcusmacman; 11-15-10 at 09:41.
Reply With Quote
  #2 (permalink)  
Old 11-12-10, 11:50
SCrandall SCrandall is offline
Registered User
 
Join Date: Aug 2009
Location: Up Nort' Wi
Posts: 140
Something like this?


ChkBox_OnClick

If ChkBox then
IncludedLabel.Visible = True
TxtPrice = 0
Else
IncludedLabel.Visible = False
Endif

End Sub


Sam, hth
__________________
Good, fast, cheap...Pick 2.
Reply With Quote
  #3 (permalink)  
Old 11-12-10, 11:57
Missinglinq Missinglinq is offline
Registered User
 
Join Date: Jun 2005
Location: Richmond, Virginia USA
Posts: 1,702
You'll have to include the part about the label visibility in the Form_Current event as well, in order for it to persist, record to record:
Code:
Private Sub Form_Current()
If ChkBox Then
 IncludedLabel.Visible = True
Else
  IncludedLabel.Visible = False
End If
End Sub
Linq ;0)>
__________________
Hope this helps!

The Devil's in the Details!!

All posts/responses based on Access 2000/2003
Reply With Quote
  #4 (permalink)  
Old 11-12-10, 18:22
marcusmacman marcusmacman is offline
Registered User
 
Join Date: Sep 2010
Location: UK
Posts: 119
thanks for looking into it for me .
Reply With Quote
  #5 (permalink)  
Old 11-12-10, 18:28
Missinglinq Missinglinq is offline
Registered User
 
Join Date: Jun 2005
Location: Richmond, Virginia USA
Posts: 1,702
That's why we're here!
__________________
Hope this helps!

The Devil's in the Details!!

All posts/responses based on Access 2000/2003
Reply With Quote
  #6 (permalink)  
Old 11-15-10, 10:17
marcusmacman marcusmacman is offline
Registered User
 
Join Date: Sep 2010
Location: UK
Posts: 119
hi there,

I tried the code but it didn't change the List_Price field. No errors were thrown up, it just didn't change. I've tried writing to the record source but that didn't work either.

I'm thinking i need to update the List_Price field just for that record somehow? Update query? to set it to 0.
cheers
marcus
Reply With Quote
  #7 (permalink)  
Old 11-15-10, 11:12
marcusmacman marcusmacman is offline
Registered User
 
Join Date: Sep 2010
Location: UK
Posts: 119
not quite there.

I've created an update query based on the table which holds the Price_List. I can't seem to reference the current record in my subform. A box pops up asking me to select the record number. Does anyone know how to reference the current record on a subform so I can use it in my query?
cheers
marcus

Last edited by marcusmacman; 11-15-10 at 15:23.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On