var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Command Buttons On Tabbed Form
10 command buttons that do nothing but run a report . . .
All buttons work well . . . UNITL . . .
Private Sub Command31_Click()
DoCmd.OpenReport "rptReMaxDesert", acViewPreview, ""
3 command buttons that work well but somehow have interfierd with ALL of the command buttons on TAB 1 to where TAB 1 buttons coding is completely gone!
What is the significence of the number (31 in this example) on Private Sub Command31_Click() ?
Without have to start all over is there a way to correct this?
Renumber the buttons?
Thanks much . . . Rick
If my cloak of invisibility isn't still on, the number is how the wizard will name the control (first command button will be 1, and so on). In your example, the name of the control is "Command31". No 2 controls can have the same name on the same form, and it sounds like that's what's happened to you. Tabs are irrelevant here, as they're all on the same form.
In reality, you shouldn't leave them named that way anyway. When you're working in your code, you know what "cmdMaxDesertRpt" does; you have no idea what "Command31" does.
I'm so frustrated I could scream!!!
NEW COMMAND BUTTON
This still fails???
What am I missing here?
Private Sub CommandCBAllRpt_Click()
DoCmd.OpenReport "rptCBALL", acViewPreview, ""
Thanks . . . Rick
ReName Command Button?
If I remove the number 3 from Private Sub Command3_Click() and change it to Private Sub CommandOpenrptName_Click() the button fails.
What is the signifigence of the number? Just the order?
How, or can I rename the Private Sub Command3_Click() and still have it function?
Thanks . . . Rick
How does it fail? Can you post the error message?
Me.Geek = True
Uh . . . my stupid side reared it's ugly head again!
Okay . . . I'm calm now. HA!
It all had to do with the number on the Commandbutton and on the properties sheet and Code section.
Once I understood that I figuered it out. Those numbers (ie, Command3) MUST MATCH or it won't work.
In the Code section AND the property sheet could I rename the Command3 button to "rptOpenReportName" and it will work?
I'll have to try that.
Thanks to all who have guided me.
Tip: Take the commands out of the form and create a module as these are re-useable. Maintain Tab_No on your tabs and put the contols on the parent testing for which tab has the focus.
if Tab_No = 1 then
else if Tab_No = 2 then