User form open

Tony Miall

Active Member
Joined
Oct 16, 2007
Messages
304
Evening all,

I am just starting to learn about user forms and have written a very simple one called EnquiryDetail. I have run the command
Code:
Sub EnquiryDetail()
EnquiryDetail.Show
End Sub

and am getting a message "Compile error: Expected function or variable" and can't understand why.

Could someone please point me in the right direction, Thanks
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
You can't call the sub the same as the name as the userform. Try

Code:
Sub EnquiryDetailShow()
EnquiryDetail.Show
End Su
 
Upvote 0
VoG, I guess:
Code:
Sub EnquiryDetailShow()
    EnquiryDetail.Show
End Su[B][COLOR="Red"]b[/COLOR][/B]
 
Upvote 0
Thanks alot Peter that worked fine.
I have a second question...

I am trying to get 6 combo boxes to enter the values into 6 cells and have written the following

Code:
Private Sub Enterenqdetail_Click()
Range("AO27") = EnquiryStatus.Value
Range("AO28") = Quotetype.Value
Range("AO29") = Category.Value
Range("AO30") = Class.Value
Range("AO31") = EnquirySource.Value
Range("AO32") = SupplyOnly.Value
End Sub

and attached to a button on the form but am geting an "Object required error" Am I going about this the right way? Thanks for your patience in advance
 
Upvote 0
Peter,

I tried that and get an error message "Method or data member not found"

I have checked the names and all are spelt correctly
 
Upvote 0
With a command button on the form I tried this successfully

Code:
Private Sub CommandButton1_Click()
Range("A1").Value = EnquiryDetail.EnquiryStatus.Value
End Sub
 
Upvote 0
Thanks Peter, I was missing the .Value after the cell reference.
Much appreciated, this stuff is a brain melt when you're learning:)
 
Upvote 0

Forum statistics

Threads
1,224,570
Messages
6,179,610
Members
452,931
Latest member
The Monk

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top