Sort in a query does not work if the cotrol in the form is invisib

F

Frank Situmorang

Hello,
I have a church membership database which have the form viewing the members
by family/household.
I want to look at them sequenced by Role number not by Role ( in text) this
is my VBA which is hang at Me!UrtRole = Me!Role.Column(2)

In the form there is a field for role and by filling it the Role swquence
will be automatically filled.

This is my whole VBA, I appreciate for anybody help.
Private Sub Role_AfterUpdate()
If Not IsNull(Me.[Role].OldValue) Then
If Me.[Role] <> Me.[Role].OldValue Then
If MsgBox("Anda telah merobah!!, apakah sengaja mau merobah?",
vbYesNo + vbDefaultButton2 + vbQuestion) = vbNo Then
' Undo the changes
Me.Role = Me.Role.OldValue
End If
End If
End If
' Update UrutanRole controls based on value selected in Role Number combo box.
Me!UrtRole = Me!Role.Column(2)
End Sub

Thanks in advance
 
J

John W. Vinson

I have a church membership database which have the form viewing the members
by family/household.
I want to look at them sequenced by Role number not by Role ( in text) this
is my VBA which is hang at Me!UrtRole = Me!Role.Column(2)

Stop.

You do NOT need to put the role number in a Form to sort a Query. In fact that
makes it much harder!

Include the RoleID field *IN YOUR QUERY*, and sort it in the Query.

It need not be made visible to do so.
 

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