Folks
This is a strange one.
I have a form that has to be non-modal as there is a "contact" command button that generates another non-modal form with contact details.
The main list box on the form is loaded with a range of cells on an underlying worksheet.
Everything seems to run ok but then the form flashes on the screen for a second (or less) and then disappears.
When the form is modal it works fine ie showmodal=true.
Here's the code; I think what I am after is some way to set the focus on the form as I assume that something else is grabbing the focus but I don't understand what.
Any ideas? Thanks
by_exp_date is just a function that queries and collects the underlying data in the workbook onto the TEMP tab.
frm_customlists is the form being loaded with the data
frm_switchcustom is the switchboard from where the code is run.
If opt_expdate.Value = True Then
by_exp_date
Load frm_customlists
Sheets("temp").Select
Range("A2").Select
st_cell = ActiveCell.Address
end_cell = ActiveCell.SpecialCells(xlLastCell).Address
frm_customlists.lst_listings.RowSource = st_cell & ":" & end_cell
frm_customlists.Caption = "Listing by Expected Date"
frm_switchcustom.Hide
Unload frm_switchcustom
frm_customlists.Show
End If
Regards
Andy
Bookmarks