473,386 Members | 1,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Can Sub & Form Button Have Same Name?

34
Hi, Everyone,

I want to click a form button and run code in a STANDARD module (not the "behind the form" class module).

I noticed the name (not the Caption) of my form button was different than the name of my Public Sub, so I changed the name of my Sub to match the name of the button. I started getting an error message.

1) Are both Subs and buttons considered objects in Access?

2) Should my Subs and buttons have different names?

Any bit of information to clear this up for me will be appreciated. Thank you!


Frank
Mar 3 '12 #1
2 1261
Killer42
8,435 Expert 8TB
Can you please provide the details of the error?

I don't know whether VB allows the same name for a Sub and a control, but it doesn't sound like a good idea.
Mar 13 '12 #2
...
'form
Public Sub command1_Click()
mycommand1
End Sub

'module
Public Sub mycommand1()
End Sub

each subs must have their unique name..

or else..

maybe you need put your codes on array index..

im confused.hohoh..:))
Apr 2 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: PhilM | last post by:
perhaps I am just a little tired, but I am having trouble with my form buttons. Firstly I name them like this name=\"round".$counter."heats\" which results in variables $round1heats...
3
by: Jon W | last post by:
I have a db table like list in a form. All the buttons have the same name. How do I know what index the button has in the button array onclick. <button name="shed" value="Edit2"...
2
by: Jeff | last post by:
I'm trying to create a dynamic form that can have multiple groups of radio buttons (each group has two buttons) with the same name. Essentially, the form allows a user to enter as many names as...
1
by: Jenny | last post by:
Hi, Can I create an array of tags by assigning same name to these tags? For example, I have two <p> tags with the same name t1. But document.all.b.value=document.all.t.length does not...
19
by: darrel | last post by:
On my vb.net page, I have 4 sets of inputs + form buttons. example: Search: (GO) Zip: (GO) County: (GO) County: (GO) The problem is if I go to the page, type in a zip code, and hit...
5
by: Alex Maghen | last post by:
In ASPX 2.0 with MasterPages and all that, my entire page only has one actual <FORM>. But there are several different sections of the page that provide what are functionally separate forms with...
5
by: plumba | last post by:
Ok, another query.... I have a checkbox at the bottom of my form which when checked unhides a <div> block which displays the submit button. The problem I have is when the clear form button is...
3
by: markux | last post by:
Hi, I have a problem with a form that it has of the input with the same name: I cannot modify code HTML inserting , in the variable $_POST is always a single value, like I can recover also the...
3
sunbin
by: sunbin | last post by:
Hi, I am having in a Trouble when working with dynamic checkboxes (i.e. checkboxes with the same name, e.g. <input type="checkbox" name = "check" value="dynamic integer value">) I have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.