message box form name

qwertyjjj

Registered User.
Local time
Today, 13:37
Joined
Aug 8, 2006
Messages
262
I can't find out the reference to the form I'm supposed to be calling the GetData Sub, it keeps erroring.

Code:
Private Sub optGroup_SortOrder_AfterUpdate()

'On Error GoTo LocalHandler

Dim optValue As Integer
Dim db As Database
Dim myquery As querydef
Set db = CurrentDb()
Set myquery = db.CreateQueryDef("")
myquery.Connect = connection

optValue = optGroup_SortOrder.Value
'MsgBox (optValue)
If IsLoaded("frmOutstandingTasks") Then
        varcc = Forms!frmOutstandingTasks!tempcc
Else
        varcc = Forms!frmAdminScreen!tempccname
End If

Forms!frmLedgerFull!frmSubLedgerFull.GetData (optValue)

Exit Sub

LocalHandler:
MsgBox (Err.Description)

End Sub

I was hoping to put a message box in the GetData Sub that would tell me the form reference.
frmLedgerFull has a subform which I thought was called frmSubLedgerFull but there's tabs and stuff as well...

Seems the subform name is frmOutstanding and its source object is frmSubLedgerFull
 
Last edited:
It looks like you are trying to use IsLoaded to find if a subform is loaded. You can't use that because it doesn't become part of the forms collection when used as a subform.

Can you elaborate a little further on what exactly you are trying to have happen? What are you trying to get to happen when the option group gets updated?
 
The IsLoaded is to check if another form is open, it's basically an admin form.
On this form I have some option buttons in the header to control sort order.
When a user clicks them it is supposed to go back to the SQL server and run the relevant stored procedure so what I want to do is refresh the data presented in the form.

However, it seems that the detail part of this form has a subform in it so, I need to refresh that subform but every reference to it the code doesn't seem to recognise.
Forms!subformname.Subroutine()
 

Users who are viewing this thread

Back
Top Bottom