Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 30th, 2006, 01:56 PM
Friend of Wrox
 
Join Date: May 2006
Location: Jonesboro, AR, USA.
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Default Make visible/invisible

Hi all,

Does anyone know the best way to make a control or label visible or invisible given a certain circumstance?

-If a user input from one form matches a number in the library I want a button and a label to be invisible on the next form that comes up. Otherwise, I want the button and label to be invisible.

Thanks for any input,

Dave

Reply With Quote
  #2 (permalink)  
Old May 30th, 2006, 02:05 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

I am not sure what the sequence of events are.

Basically set the label and button to Visible = No as the default, and then use events (including the forms on current event) to check the value and set the property based on the value.

Where will the value be stored and how referenced?

mmcdonal
Reply With Quote
  #3 (permalink)  
Old May 30th, 2006, 02:18 PM
Friend of Wrox
 
Join Date: May 2006
Location: Jonesboro, AR, USA.
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The user inputs a design number in a textbox
The number is stored in variable mycnt
A query counts how many #'s match the one that was input

If the query counts one or more then a form opens with the matching records displayed on the screen.
If the query doesn't find a match then the form opens with a label saying no match and a button that can add the new #.

DoCmd.Requery
Dim mycnt, mycnt_new As Integer
mycnt = DCount("*", "Q_check_exist")
If mycnt >= 1 Then

David


Reply With Quote
  #4 (permalink)  
Old May 30th, 2006, 02:20 PM
Friend of Wrox
 
Join Date: May 2006
Location: Jonesboro, AR, USA.
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are you saying set the button and label to Visible = No in properties or in the code?


dave

Reply With Quote
  #5 (permalink)  
Old May 31st, 2006, 01:42 AM
Registered User
 
Join Date: May 2006
Location: Amsterdam, , Netherlands.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

labelnomatch.visible = cbool(mycnt=0)
button.visible = cbool(mycnt=0)

Reply With Quote
  #6 (permalink)  
Old May 31st, 2006, 09:20 AM
Friend of Wrox
 
Join Date: Dec 2005
Location: , , .
Posts: 142
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If mycnt >= 1 Then
    'Open form displaying designs
Else
    'Open different form stating no such record found, with button to add new record
End If

I don't believe you need to manipulate visibility to solve that problem.

Reply With Quote
  #7 (permalink)  
Old May 31st, 2006, 10:59 AM
Friend of Wrox
 
Join Date: May 2006
Location: Jonesboro, AR, USA.
Posts: 144
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the feed back guys!

I tried the CBOOL code, but couldn't quite get it to work for me.
I think I may just go for the multiple form approach.

Thanks again,

-Dave

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 Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide and make visible scandalous ASP.NET 2.0 Basics 0 May 24th, 2007 08:51 AM
how to make the print button invisible dipti.agrawal ASP.NET 2.0 Basics 0 March 11th, 2007 01:20 PM
to make checkboxes visible in datagrid C# windows bhavna General .NET 1 March 5th, 2007 10:41 AM
visible/invisible stealthdevil Access VBA 4 December 1st, 2006 05:40 PM
How do you make a label visible in a form Brian263 Access 2 March 19th, 2004 03:32 PM



All times are GMT -4. The time now is 09:50 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.