Hi, I have 2 questions:
1. I'm looking for a better way to get a UserForm (frmParts) to show right from the start as soon as I open the workbook while hiding the application. I use the following when I initialize the application:
Any ideas how to accomplish this in a better way?
2. Later on, I add some parts to my inventory, but if I don't make the application visible, it doesn't save the data. So, I have to make it visible and then hide it again. Is there a right way to accomplish the save without having to unhide/hide the application? This is the applicable code I used (ComboBoxes & TextBoxes involved):
Thank you in advance for your help,
Sam
1. I'm looking for a better way to get a UserForm (frmParts) to show right from the start as soon as I open the workbook while hiding the application. I use the following when I initialize the application:
Code:
Application.Visible = False
frmParts.Show
Any ideas how to accomplish this in a better way?
2. Later on, I add some parts to my inventory, but if I don't make the application visible, it doesn't save the data. So, I have to make it visible and then hide it again. Is there a right way to accomplish the save without having to unhide/hide the application? This is the applicable code I used (ComboBoxes & TextBoxes involved):
Code:
'copy the data to the database
Application.Visible = True
Application.ScreenUpdating = False
With ws 'ws=Inventory
.Cells(1, 1).Value = Me.cboPart.Value 'Part Number
.Cells(1, 2).Value = Me.cboLocation.Value 'Part Location
.Cells(1, 3).Value = Me.txtQty.Value 'Quantity
End With
Sheets("Parts").Activate
ActiveWorkbook.Save
Application.Visible = False
Application.ScreenUpdating = True
Thank you in advance for your help,
Sam