Help me solve this mystery - Opening form issue

jonathanchye

Registered User.
Local time
Today, 15:01
Joined
Mar 8, 2011
Messages
448
I really don't know what is wrong so hopefully someone could shed a light on this issue.

I have a main menu with users see after logging in through a login screen. This main menu is formatted as a dialog type without any Recordsource.

The really strange thing is that if I click anywhere on the main menu except on controls, it will automatically closes the main menu and open up a particular form. I have a button that does that but even after removing this button this still happens!

I have no clue as to why this could happen so hopefully someone could shed some light on this mystery.
 
You have by accident assigned an event handler to eg. your details section. OPen the form in design view, open the Properties, click on the bar on top of the details section of your form (that way you select the Details section) , choose the tab Event in the porperties, and see if you have any OnCLick handler there. If not here, do same for Header/Footer sections.
 
You have by accident assigned an event handler to eg. your details section. OPen the form in design view, open the Properties, click on the bar on top of the details section of your form (that way you select the Details section) , choose the tab Event in the porperties, and see if you have any OnCLick handler there. If not here, do same for Header/Footer sections.

Bless you! That's it... had a rogue macro in the Detail section. I was checking the Event handler for Form but can't find anything :)

Thank you!
 
Hmmm another problem I am afraid :(

I have code which opens up a form according to the value bound to the first column of a listbox.

There are basically 3 types of forms to open, 2 of them opens showing the correct record but one refuses to show anything. It opens an empty form. I've checked all values and the seem ok. What is stranger is that I have another textbox based form which basically does the same thing - user enter number and then press button to open form. The one not showing correctly (frmCustomerNonConformance) opens correctly there but not in my listbox code :(

Here is my code :
Code:
Dim temp As Variant
Dim tempType As Variant

temp = Me.listResults.Value
tempType = DLookup("[Type]", "tblNcrMaster", "[ncrNo]=" & temp)

If tempType = "Supplier" Then
DoCmd.Minimize
DoCmd.OpenForm "frmSupplierNonConformance", , , "ncrNo=" & temp
' Faulty bit here
'Opens empty form
ElseIf tempType = "Customer" Then
DoCmd.Minimize
DoCmd.OpenForm "frmCustomerNonConformance", , , "ncrNo=" & temp
ElseIf tempType = "Internal" Then
DoCmd.Minimize
DoCmd.OpenForm "frmInternalNonConformance", , , "ncrNo=" & temp
Else
MsgBox "Error - Can't open NCR"
End If
 

Users who are viewing this thread

Back
Top Bottom