Hi all,

I'm stuck - it might be easy but I don't work with VB6 much.

I have a form that is open and has a button on it which opens a second form overtop of it. when the second form opens it locks the first form. Upon exit from the second form I can unlock the first form but it still 'appears' locked, thus I think I need to 'refresh' or reload the first form at that point.

Any ideas?

Hello,

How do you load the second form??
If you use:

Form2.Show vbModal

Then it should be unlocked automatically.
And if you really need to refresh you can use:

Form1.Refresh

but that's won't unlock the form, it will just refresh the form graphics.

If that code solves the problem, then please mark this thread as SOLVED, otherwise you should show us your code.

Thanks,

I think I have it finally - what I did was call the second form and it locked the first and was drawn on top of the first form.

.refresh redraws the form but doesn't refresh the data and thus still appeared to be locked.

I've used

Public Sub ClearLocks()
   Dim strContractNumber As String
    strContractNumber = frmContractView.txtContractNumber
    Call Main.LockRecordClearByRefNumOrUser(frmContractView.txtContractNumber, Main.strUserName)
    Call mdlContractEntry.ContractIsLoaded(frmContractView.txtContractNumber, True)
    
    Call frmContractView.GetContractData(strContractNumber)
    
End Sub

and am testing it now but it's worked a bunch already.

Thanks again

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.