473,805 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

9 Forms using only the one Table

20 New Member
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 ProjectCommerci al(PC), another called ProjectTechnica l (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 BrainstormingTa ble, 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 BrainstormingTa ble, 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 BrainstormingPr ojectTechnical) for the PT part and BSPC for the PC part, with the record source to BrainstormingTa ble. 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 BrainstormingTa bleDescription is the description field in BrainstormingTa ble, similar to PT in the PT table, or PC in the PC table etc.

What I noticed is that Me.Name is returning BrainstormingTa ble, 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 1425
puppydogbuddy
1,923 Recognized Expert Top Contributor
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?...plea se clarify.
Jun 12 '08 #2
rdsandy
20 New Member
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?...plea se 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 ProjectTechnica l, TableID would be set to 1, if the record was in ProjectCommerci al 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 New Member
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 Recognized Expert Top Contributor
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
2741
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 else is so well done that the way you create forms seems to be too cumbersome, in particular making it so that a pull down menu selects a value that you assign it. In any case, does anyone know of any php based (or other readily accepted web...
2
2550
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, radio, checkbox, and dropdown. When the form Submit button is clicked, I then need the input data either written to another location on the same page, or written to another page (a different frame would be fine)
6
2873
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 loop through all the forms in a database and pull information about the form (controls and properties). We would need to do the same in our VB.NET project; loop through the project and get the web form's control and property information...
1
1671
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 the subsequent forms to read. i am unable to use this table in a subform as i am not able to carry the other info over. eg. mainform = student details(id,name,class) subform = subject(id,subject)
9
1289
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 record that I just finished working on. Ideas?
4
2194
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 (one) unbound form, if all the fields are the same for multiple forms populating them with Queries? I have a makeshif menu form with command buttons and I would like to eliminate all the forms and replace them with one unbound form for three...
19
4117
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 the code that implements managing unbound controls on forms given the superior performance of unbound controls in a client/server environment. I can easily understand a newbie using bound controls or someone with a tight deadline. I guess I need...
3
6672
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 & "", "" & AS Student, activities.activityDescription, studentScores.score FROM groups INNER JOIN (students INNER JOIN (activities INNER JOIN studentScores ON
0
4254
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 Applications and owner of Access Microsystems. Doug can be reached at doug@accessmicrosystems.com. --------------------------------------------------------------------------------
5
1989
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 linked table called tblComponents and then I bounded the original forms to this new table. I did change the control source: Description (Field name) RowSource Type: Table/Query (which remains the same)
0
9718
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10614
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10369
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5544
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4327
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3847
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.