Form

krzysiekk

Registered User.
Local time
Today, 14:26
Joined
Dec 2, 2009
Messages
74
Hi I got query with specific criteria
query returning list like:
Name 1
Name 2
Name 3

I loading query into Continuous Form 'sub1'

Next I creating subform in dashboard form for each name I got button, default is
Me.Command1.Enable = False
Me.Command3.Enable = False
Me.Command3.Enable = False
But when Name 3 exisiting in subform I change status from False to True

If Forms!Dashboard.sub1!name.Value = "Name 3" Then
Me.Command3.Enabled = True
Else
Me.Command3.Enabled = False
End If

its working with first record in subform

please advise??
 
You can't enable or disable all of the controls on a continuous subform. The control is the same control and it will enable or disable for all records because the viewing of the subform is a little "trick" which uses the same control but kind of a clone for the viewing. So, you can't do many things on a continuous or datasheet view subform because the control is the same control.
 
I want disable or enable in dashboard form using subform for criteria
 
Again, You can NOT do what you want in a continuous or datasheet subform. You have to be in SINGLE FORM VIEW (for the subform) in order for your code to work, since there is only one record displayed at a time).
 
Sorry I thing you not understnad me.

I got subform with continuous rows, and the main form - dashboard- single form. I imported - linked subform into dashboard thats mean in single form I got subform (continuous) now in single form I created 3 buttons and all disable. When in subform exisitng entry with text value = Name1 then button1 in single form will be enable.

Problem is just working with first row in subform if is on second row Name2 button2 is still disable
 
Okay, sorry - I know it is hard communicating in a language which isn't your native one.

So, if the code is working for the first record then you might need to place it in the subform's ON CURRENT event ALSO.
 
I added event in Dahsbord form in FormOpen

Becouse like I said buttons exisint in dashboard form.

(If Forms!Dashboard.XH!Collection.Value = "Name1" Then
Me.Command1.Enabled = True
Else
Me.Command1.Enabled = False
End If)
 
If on the Dashboard form Open event, it will never fire again so that is why it isn't working. You probably should have it in the SUBFORM's ON CURRENT and AFTER UPDATE events instead.
 

Users who are viewing this thread

Back
Top Bottom