Link to home
Start Free TrialLog in
Avatar of Joseph S
Joseph S

asked on

Creating a specific table for Microsoft Access Form.

Need help with creating a specific table for Access form. I will pay for you for time. I cannot explain over here, as it is complicated and easy to misunderstand. I will explain over Skype or gotomeeting through screen sharing if you are interested.
Avatar of PatHartman
PatHartman
Flag of United States of America image

The design process does NOT involve creating tables for specific forms.  You design tables based on the data you have and how it needs to be organized.  I'm going to guess that you are trying to reproduce a complicated paper form that has multiple sets of data and that is why you are having a problem.  In Excel, the data and presentation layers are merged but in a relational database, they are separate.  In many applications, the tables do not reflect at all the forms and reports the application needs.  

If you post a picture of the form you are trying to mimic, we can confirm this as the issue and offer solutions.
Avatar of Joseph S
Joseph S

ASKER

@PatHartman, Thank you

I think I figured out a solution. If I want to create a table like excel it has to be a subform.

How do I reference a subform  in VBA?
If I want to create a table like excel it has to be a subform.
Hmm, when working with databases, forget about how data are displayed, but think about what they represent, and how they are related to each other.
Once the data model is in place, you can think about graphic design.

How do I reference a subform  in VBA?
Basically, a subform is held within a subform control, wich have a Form property.
So the syntax to refer to it is something like the following:
Dim frm As Access.Form
Set frm = SubFormControlName.Form
    '// Or
Set frm = SubFormControlName!Form

Open in new window

It depends on how/where you are referencing the subform

If you are in the main form, then you can simply do
Me.YourSubFormName

Open in new window

Otherwise, refer to http://www.theaccessweb.com/forms/frm0031.htm for the proper syntax to use
How do I reference a subform  in VBA?
You almost never manipulate a subform from outside the subform.  Subforms are just forms that happened to be embedded on other form.  When your code runs in any form, it is always addressing the CURRENT record NOT all records or one specific record unless you were to create a code loop to manipulate the recordset clone of the form.

You are quite unlikely to need code to manipulate all the records of the form. Forms are interactive and intended to work on one record at a time.  Batch processes work on recordsets and do things like print the payroll checks for the period.  You wouldn't want to touch the record manually of every person you wanted to pay this period.  You are much more likely to need to use conditional formatting if what you are trying to do is to add emphasis to particular field values.

We of course cannot help you without questions.  You should now understand that your problem is not as bad as you think it is since without explanation, I was able to guess what was troubling to you.  You may still decide that you are not sufficiently experienced to implement the solution but you also might be surprised at what you can do with good guidance.

Since you are inexperienced, it is even more important that you pose questions framed as the problem you are trying to solve rather than "how do I implement the solution I think I need?".  This is evidenced by your current question.  You are asking how to create a table for a specific form because your universe does not include the knowledge of subforms.  Try not to box yourself in like that.  There are many helpful people here but in their zest to help, they may be leading you down a garden path of your own making and on a journey you do not need to take to implement a completely useless "solution" as the table you requested would be.. You can probably create one if you end up with less than 255 fields but it is the wrong method   The simplest, least code, solution is invariably the best.  It will be easier to develop, easier to maintain, easier to enhance over the long term.

The basis of all Access applications is tables.  They are the foundation.  If you don't pay enough attention to them, you end up like that luxury high-rise in San Francisco that is gradually becoming San Francisco's leaning tower.
The easiest way to reference any form is provided it has code behind (easily ...just open the form in Design View...hit Design Tab-->Click the "View Code" and just close it...
after that you can reference it everywhere in your code like
Form_NameOfTheFormWeAreInterested.(Here after typing the dot "." Intellisense kicks in and you get everything)

Open in new window

This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.