473,387 Members | 1,456 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,387 software developers and data experts.

9 Forms using only the one Table

20
Hi,

I am going to start off and apologise for the length of this post!

I have a form with 9 subforms on. Currently, each subform has its own table. Each of the tables have exactly the same field layout (ie: same fields, but slightly different names for whichever table it is). Here is an example of what I mean:

One table is called ProjectCommercial(PC), another called ProjectTechnical (PT). In these two tables (plus the other 7 tables), 7 fields are identical in each table, and 2 fields are nearly identical (in PT theres a PTID field and a PT field - field with same name as table, and in PC theres a PCID field and a PC field).

I want to normalise this so that there is only one table, and the 9 subforms use this one table. I made a table called BrainstormingTable, and have a TableID field, which will serve to say if its a PT, or PC etc. Part of the reason I want to normalise it is there is a lot of code which is really unnecessary if there is only one table.

Ive made a couple of subforms (placed on a new form) and set them to BrainstormingTable, but I don't know how to add in a row and make the field TableID equal to 1 for example if the subform name is PT. I have named the subform BSPT (stands for BrainstormingProjectTechnical) for the PT part and BSPC for the PC part, with the record source to BrainstormingTable. I tried this code but it doesn't work:

Expand|Select|Wrap|Line Numbers
  1. Private Sub BrainstormingTableDescription_AfterUpdate()
  2.     If Me.Name = "BSPT" Then
  3.         MsgBox "BSPT"
  4.     ElseIf Me.Name = "BSPC" Then
  5.         MsgBox "BSPC"
  6.     End If
  7. End Sub
  8.  
where BrainstormingTableDescription is the description field in BrainstormingTable, similar to PT in the PT table, or PC in the PC table etc.

What I noticed is that Me.Name is returning BrainstormingTable, which is the name of the subform when it is opened as a normal form (if that makes sense). What I want is to basically check if the subform name on the main form is equal to BSPT, or BSPC etc and if so then set the TableID field to the correct number (I currently have a msgbox for testing purposes).

Many thanks in advance,

Andrew
Jun 11 '08 #1
4 1401
puppydogbuddy
1,923 Expert 1GB
Andrew,
It sounds to me like you forgot to set up the Master/Child Links on TableID in the subform control. If you do that, Access will manage the links for you. To set up the links, click on the subform control, which is on the border between the main form and the subform....then invoke the property sheet, go to master link and click the builder button with 3 dots on the right. Ditto for the child link.

As for the code, are you trying to look up the value in your table after it has been entered on the subform?...please clarify.
Jun 12 '08 #2
rdsandy
20
Andrew,
It sounds to me like you forgot to set up the Master/Child Links on TableID in the subform control. If you do that, Access will manage the links for you. To set up the links, click on the subform control, which is on the border between the main form and the subform....then invoke the property sheet, go to master link and click the builder button with 3 dots on the right. Ditto for the child link.

As for the code, are you trying to look up the value in your table after it has been entered on the subform?...please clarify.
Sorry I didn't get back to this, I put this on the side for a while to do other things.

I did forget to put the links in, and have done that. What I was asking before was how to set the tableID field to a number for which ever subform I was in, so if the record was going into ProjectTechnical, TableID would be set to 1, if the record was in ProjectCommercial then TableID would be set to 2 etc. I forgot that you could set the default value on the text box of the subform, as opposed to the default value in the actual table, which is what I have done.

One question regarding this site though, how do you put email notifications on so that when someone replies to the post I am notified? At the moment on my settings, I have under Edit Options, Default Thread Subscription Mode set to "Instant Notification", but under List Subscriptions, each of my threads/threads I posted in are set to "None" for notifications. How do I change them, and also how do I have new threads in the future set to instant notifcation?

Thanks
Jun 25 '08 #3
rdsandy
20
I fixed all the current threads to instant notification (by selecting them all and setting them to instant notification from the drop down box at the bottom), but will new threads have notifcations on do you know?
Jun 25 '08 #4
puppydogbuddy
1,923 Expert 1GB
I fixed all the current threads to instant notification (by selecting them all and setting them to instant notification from the drop down box at the bottom), but will new threads have notifcations on do you know?
It should if you signed in and changed your email settings, checking the setting for immediate notification.
Jun 26 '08 #5

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

Similar topics

6
by: gonzalo briceno | last post by:
I have been using phplib for a while and I really like the framework except for form creation. Maybe it is me but I in my opinion there isn't a good way to create forms or should I say, everything...
2
by: Richard | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** HI, I am working on a project where I need to input data to a (local) HTML page using multiple form elements, such as text,...
6
by: ALthePal | last post by:
Hi, I'm not sure if we are able to or even how to loop through the web forms in a VB.NET project during design time. In MSAccess we are able to go through the database -> forms collection and...
1
by: jbroome | last post by:
I have a main form which contains information for several subforms which I can link no problem but i also have some other information from another table which i wish to attach to the main form for...
9
by: BLUE WATER | last post by:
Help, When I am finished entering in data into my form A, I press the save button that saves this new data to a new record. However I would like my other form to open at a specific record, the...
4
by: Lumpierbritches | last post by:
Thank you once again for any and all assistance. I'm building an application that's getting quite bulky due to the number of forms, macros and procedures. I was wondering if there's a way to use 1...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
3
by: Richard Hollenbeck | last post by:
I have the following query in my form's code: Private Function Get_Data(fieldNum As Integer) Dim strSQL As String Dim db As DAO.Database Dim rs As DAO.Recordset strSQL = "SELECT & "", "" & ...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
5
by: agarwasa2008 | last post by:
Hi, I have a linked table called tbltest and some bounded forms (which add, update, delete records) that were created using that linked table. For some necessary reasons I had to create another...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.