Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2008

Tip: Looking for answers? Try searching our database.

Visible Control Source based on Combo Selection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Johnny - 29 May 2008 20:25 GMT
This should be fairly simple, but would someone assist to see what I am
missing on this.  I have a combo based on a value list of 3 asset options:  
PC, Printer, Other.  If the form shows PC on the combo I want the computer's
machine name to be visible, but not visible if the form shows the other two
options in the combo.  Fairly basic.  Device type is the name of my combo.  
Here is my code on the on open properties:

Private Sub Form_Open(Cancel As Integer)
If [Device type] = "PC" Then
   [Machine Name].Visible = True
Else
   [Machine Name].Visible = False
End If
End Sub

I also have the machine name control set to visible "no".

I'm a simpleton at coding and have spent the afternoon trying to make this
work and reading other similar posts.  Any suggestions is greatly appreciated.

Thanks in advance.
Signature

Johnny

Johnny - 29 May 2008 20:51 GMT
Sorry if I bothered anyone.  I just needed to have this loaded "on Current"
and not "on Open".  Thanks to anyone who checked out my question.
Signature

Johnny

> This should be fairly simple, but would someone assist to see what I am
> missing on this.  I have a combo based on a value list of 3 asset options:  
[quoted text clipped - 17 lines]
>
> Thanks in advance.
PJFry - 30 May 2008 07:05 GMT
The first thing to do is to check out the actual value of the combo box.  
Check the properties, Format, Column Count.  My guess is that you may have a
hidden column and the if statement does not know which column to evaluate.

Try that and let me know what you get.

PJ

> Sorry if I bothered anyone.  I just needed to have this loaded "on Current"
> and not "on Open".  Thanks to anyone who checked out my question.
[quoted text clipped - 20 lines]
> >
> > Thanks in advance.
Johnny - 30 May 2008 13:57 GMT
PJFry,

Thank you for checking out my post, but I'm not honestly sure what you are
saying.  As far as I can tell the combo is set to only one column count.  I
thought I had this figured out yesterday by making my code work "on current"
instead of "on Open", and it did work on the Machine Name control just fine.  
Now they have thrown a loophole in the mix and added the combo to not only be
PC, PRINTERS and OTHER, but now they want to add LAPTOP and SERVER and have
it do the same thing for PC where the machine name is not visible unless PC
or LAPTOP or SERVER is selected.  I tried this, but it did not work:
Private Sub Form_Current()
If [Device type] = "PC" & _
Or [Device type] = "Server" & _
Or [Device Type] = "Laptop" Then
   [Machine Name].Visible = True
Else
   [Machine Name].Visible = False
End If

End Sub

Suggestions?  Thank you.
Signature

Johnny

> The first thing to do is to check out the actual value of the combo box.  
> Check the properties, Format, Column Count.  My guess is that you may have a
[quoted text clipped - 28 lines]
> > >
> > > Thanks in advance.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.