Sub Show Form () Error

bbworld

New Member
Joined
Jul 29, 2019
Messages
10
Hello,

I am a newbie with VBA and have reviewed the previous articles on the Sub Show Form () error I am getting in the attached.

I have followed a learning video and rechecked my content twice yet the same error is presenting.

The workbook is attached and the code in particular that is causing grief is;

Sub Showform()

frmForm.Show

End Sub

I have checked the declaration on the Sub and it matches the code.

Seriously at a loss.
 

Attachments

  • Sub Error.PNG
    Sub Error.PNG
    5.4 KB · Views: 286

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Runtime Error 13 (Google tells me this is a very generic error code)

when you go to debug, it highlighted the code I had entered to show the form.
 
Upvote 0
Ok in the VB editor select tools > Options > General > Check "Break in class module" > OK.
The run the code again, when you click debug it should take you to the line that is causing the problem.
 
Upvote 0
This is the line that was highlighted.

This is in the lesson (checked the video content twice)

Not sure why this has changed from the show.form.

Cheers
D
 

Attachments

  • Debug Error.PNG
    Debug Error.PNG
    125.5 KB · Views: 170
Upvote 0
Remove the space between the counta & the (
VBA Code:
   irow = [counta(database!A:A)]
 
Upvote 0
That has worked. Thank you Fluff.

What a huge difference a space makes.

Another QQ if I may?

In the User Details frame, the identifier, I was trying some code to generate a alphanumeric key that is unique. (Say hex, 8 characters)

Private Sub txtPW_Change()

Dim strPassword As String

Dim i As Integer

End Sub

I have this within the frmForm section.

Q1. Would this code generate a random alphanumeric key?

Q2. Is this code in the correct section, frmForm?
 
Upvote 0
That code won't do anything at all, all you have done is declared two variables.
But to get help on that, you will need to start a new thread.
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,181
Members
452,615
Latest member
bogeys2birdies

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