Hide/unhide subform

Try this in the After Update event of the JobNo ComboBox...
Code:
Private Sub JobNo_AfterUpdate()

If Me.LookUpAlarms = 2 Then
Me.FirstLetterSent = True
End If

If Me.LookUpAlarms > 3 Then
Me.SecondLetterSent = True
End If

End Sub

IMO
 
It worked,

it would do wouldn't it, cause it's IMO

well I'm going green with envy

boy I hate you.


lol:p

thanks again
IMO
 
LOL, Glad it worked :)

IMO
 
Hi again

I have been adding more features based on the code that you helped me with...works great.

it works well because it depends on the alarm count being 2 or more than 4.

I now have added a few lables and toggle buttons that are visible/invisible depending on what command buttons have been pressed............. also works great.... it updates all current records that it needs to.

The problem is that when more records are created these lables are not updated

Similar problem to last post although this time I can't use your previous solution of:

Private Sub JobNo_AfterUpdate()
If Me.LookUpAlarms = 2 Then
Me.NameOfLable=True
If Me.LookUpAlarms > 3 Then
Me.NameOfLable= True
End If
End Sub

This does not work because they do not rely on the alarm count,
they need to be updated according to the property Name

do you possibly know of another way of updating these?

thanks
 
Last edited:
Try creating another "If" statement (or two) in the AfterUpdate event just for the labels, below the original code, something like...
Code:
Private Sub JobNo_AfterUpdate() 

'------Original Code Stays Here------
If Me.LookUpAlarms = 2 Then 
Me.NameOfLable=True 
If Me.LookUpAlarms > 3 Then 
Me.NameOfLable= True 
End If 
'------End Of Original Code------

If Me.PropertyName = "A Property Name" Then
Me.LabelName.Visible = True
Else
Me.LabelName.Visible = False
End If

If Me.PropertyName = "Another Property Name" Then
Me.AnotherLabelName.Visible = True
Else
Me.AnotherLabelName.Visible = False
End If

IMO
 
Last edited:
IMO
Bet you thought this one was dead and buried.


I don't see how that will work, unless I enter every property name that could be used in the code......we have about 500 different properties ....seems a bit of a task.

Thanks for your reply:)
 
Ahh, lots of properties!! You could use DCount in the AfterUpdate event which would then count the properties in your query giving you the same results but not having to list them all.
Code:
Private Sub JobNo_AfterUpdate() 

'------Original Code Stays Here------
If Me.LookUpAlarms = 2 Then 
Me.NameOfLable=True 
If Me.LookUpAlarms > 3 Then 
Me.NameOfLable= True 
End If 
'------End Of Original Code------

If DCount("PropertyNameColumn", "PropertyQueryName") = 2 Then
    Me.YourLabel.Visible = True
    Me.YourToggleButton = True
Else
    YourLabel.Visible = False
    Me.YourToggleButton = False
End If

End Sub

IMO
 
I was hoping to beat you this time with a solution

cheers :p
 
You could also use DLookup in much the same way depending on the criteria you want.

IMO
 
I have tried your suggestion but it I can't get it to work this time#

'If DCount("BG_SITE", "qryAlarm") = 2 Then
' Me.lblFirstActionPrintReminder.Visible = True
'Else
'lblFirstActionPrintReminder = False
'End If




the problems I have found are:
"lblFirstActionPrinted" and "lblSecondActionPrinted" are visible= True when previous records are visible = False

I also have two other toggles that are false when they should be True

perhaps I have used your code incorrectly :o

Thanks
 
The code should work. This line
Code:
lblFirstActionPrintReminder = False
should be...
Code:
lblFirstActionPrintReminder.Visible = False
See if that helps, if not, post your DB and I'll take a look.

IMO
 

Users who are viewing this thread

Back
Top Bottom