Adding new record for tabbed forms

petro62

New Member
Joined
Jul 15, 2013
Messages
46
Office Version
  1. 365
Platform
  1. Windows
I am back.

I am not sure if I went about this right, but I created all my individual input pages/forms. I then created a tabbed form and dragged those forms to their specific tab. I have a button on my menu that when clicked will open this user input form and close the main menu form. Along with that though I would like to get all the forms on new record (it currently just loads the first record in the database).

I tried with the Macro GoToRecord. I set the type as form, the object name as the form (Project Information) and set Record to New.

When I run the macro I get an error saying Project Information isn't open. It is open in the tabbed User Input Form, but the actual form itself is not open. I tried putting in the User Input for and that doesn't do anything, but doesn't return an error. So I am stuck on how to solve this. I am not sure if it is the way I inserted the forms into the tabbed form or what. I upload an image of the Macro setup.
 

Attachments

  • macro image.JPG
    macro image.JPG
    21 KB · Views: 15
I am confused what the .NameofSubformControlonPageHere
It means the "name of the subform control that is on a/the page". Oddly enough, the subform control is a child of the main form (parent). You would think that the control is a child of the page, but it's not. You can test this in the immediate window by asking questions when the form is open (either form or design view) to make sure you have the hierarchy correct. Type ? and the reference then Enter to test - I use .Name property to test my objects hierarchy because I've yet to find an object that doesn't have a name. So taking it in steps:
?Forms!User Input.Name
?Forms!User Input.Project Information.Name
and so on, BUT as I type this I see a big issue. Going forward, never use spaces or special characters in object names (save for perhaps underscore) or you can/will spend hours trying to find a problem. User Input must be typed as [User Input] because of the space(s).
Try fixing that in the syntax I gave you. Could also try the hierarchy test first so that you can learn what your object hierarchy is, but be sure to wrap those names with spaces in brackets:
?Forms![User Input].[Project Information].Name

Last, "doesn't work" doesn't help others help you very much. It could mean anything. I suspect in this case you got an error because of the spaces.
Suggest you read these:
Naming conventions
- General: Commonly used naming conventions

What not to use in names
- Microsoft Access tips: Problem names and reserved words in Access
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
cross posted
 
Upvote 0
I am going back now and removing spaces.
It means the "name of the subform control that is on a/the page". Oddly enough, the subform control is a child of the main form (parent). You would think that the control is a child of the page, but it's not. You can test this in the immediate window by asking questions when the form is open (either form or design view) to make sure you have the hierarchy correct. Type ? and the reference then Enter to test - I use .Name property to test my objects hierarchy because I've yet to find an object that doesn't have a name. So taking it in steps:
?Forms!User Input.Name
?Forms!User Input.Project Information.Name
and so on, BUT as I type this I see a big issue. Going forward, never use spaces or special characters in object names (save for perhaps underscore) or you can/will spend hours trying to find a problem. User Input must be typed as [User Input] because of the space(s).
Try fixing that in the syntax I gave you. Could also try the hierarchy test first so that you can learn what your object hierarchy is, but be sure to wrap those names with spaces in brackets:
?Forms![User Input].[Project Information].Name

Last, "doesn't work" doesn't help others help you very much. It could mean anything. I suspect in this case you got an error because of the spaces.
Suggest you read these:
Naming conventions
- General: Commonly used naming conventions

What not to use in names
- Microsoft Access tips: Problem names and reserved words in Access
Yeah I am going to back to fix the names. Does that apply to everything? As in I am changing all the button and combobox names and such, but does that also include form names and even the page names on the tab control? So the tabs on the tab control will need to say ProjectInformation? Just check to what all it applies to.
 
Upvote 0
I suggest that you
a) fix one issue (syntax) before tackling another (names)
b) review my post at your other thread. I updated it to include a link pertaining to my comment. I don't post it here because I did that once and got reprimanded for acting like a moderator.
 
Upvote 0
It means the "name of the subform control that is on a/the page". Oddly enough, the subform control is a child of the main form (parent). You would think that the control is a child of the page, but it's not. You can test this in the immediate window by asking questions when the form is open (either form or design view) to make sure you have the hierarchy correct. Type ? and the reference then Enter to test - I use .Name property to test my objects hierarchy because I've yet to find an object that doesn't have a name. So taking it in steps:
?Forms!User Input.Name
?Forms!User Input.Project Information.Name
and so on, BUT as I type this I see a big issue. Going forward, never use spaces or special characters in object names (save for perhaps underscore) or you can/will spend hours trying to find a problem. User Input must be typed as [User Input] because of the space(s).
Try fixing that in the syntax I gave you. Could also try the hierarchy test first so that you can learn what your object hierarchy is, but be sure to wrap those names with spaces in brackets:
?Forms![User Input].[Project Information].Name

Last, "doesn't work" doesn't help others help you very much. It could mean anything. I suspect in this case you got an error because of the spaces.
Suggest you read these:
Naming conventions
- General: Commonly used naming conventions

What not to use in names
- Microsoft Access tips: Problem names and reserved words in Access
Where exactly am I typing this while in Design view?

?Forms!User Input.Name
?Forms!User Input.Project Information.Name
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,149
Members
453,021
Latest member
Justyna P

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