refresh with a toggle button

  • Thread starter evilcowstare via AccessMonster.com
  • Start date
E

evilcowstare via AccessMonster.com

Ok this is going to be a stupid Q but so far what im trying doesnt work.
I am using a toggle button which when clicked brings up some hidden text
boxes to enter or view details, what I want to do is when the button is
clicked again to make them invisible I want the page to refresh itself, so
far I have been using...

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

on the on click and after update on the button but neither seem to work, any
ideas?

Thank You
 
K

Klatuu

First, you need to drop the Dark Ages code. It is almost impossible to read
and understand.

Here is a quick example I threw together. Start by making all the text
boxes and tier lables visible properties No in design view. Then use this
code as an example and change the name to use your actual names:

Private Sub Toggle0_Click()
With Me
.Text1.Visible = .Toggle0
.Text3.Visible = .Toggle0
.Label2.Visible = .Toggle0
.Label4.Visible = .Toggle0
End With
End Sub
 
E

evilcowstare via AccessMonster.com

Hi that is code to make stuff visible, I am looking to refresh the page, the
code I put is what access shows up as code to refresh if you use the wizard.

I need to refresh the whole form whenever I click the toggle button


First, you need to drop the Dark Ages code. It is almost impossible to read
and understand.

Here is a quick example I threw together. Start by making all the text
boxes and tier lables visible properties No in design view. Then use this
code as an example and change the name to use your actual names:

Private Sub Toggle0_Click()
With Me
.Text1.Visible = .Toggle0
.Text3.Visible = .Toggle0
.Label2.Visible = .Toggle0
.Label4.Visible = .Toggle0
End With
End Sub
Ok this is going to be a stupid Q but so far what im trying doesnt work.
I am using a toggle button which when clicked brings up some hidden text
[quoted text clipped - 8 lines]
Thank You
 
K

Klatuu

Not a problem, just add Me.Refresh to the code.
--
Dave Hargis, Microsoft Access MVP


evilcowstare via AccessMonster.com said:
Hi that is code to make stuff visible, I am looking to refresh the page, the
code I put is what access shows up as code to refresh if you use the wizard.

I need to refresh the whole form whenever I click the toggle button


First, you need to drop the Dark Ages code. It is almost impossible to read
and understand.

Here is a quick example I threw together. Start by making all the text
boxes and tier lables visible properties No in design view. Then use this
code as an example and change the name to use your actual names:

Private Sub Toggle0_Click()
With Me
.Text1.Visible = .Toggle0
.Text3.Visible = .Toggle0
.Label2.Visible = .Toggle0
.Label4.Visible = .Toggle0
End With
End Sub
Ok this is going to be a stupid Q but so far what im trying doesnt work.
I am using a toggle button which when clicked brings up some hidden text
[quoted text clipped - 8 lines]
Thank You
 
E

evilcowstare via AccessMonster.com

Thank You
Didnt remeber the Me. bit
Not a problem, just add Me.Refresh to the code.
Hi that is code to make stuff visible, I am looking to refresh the page, the
code I put is what access shows up as code to refresh if you use the wizard.
[quoted text clipped - 22 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top