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

Button Control And Referencing

HopeHal
I have a form which references two tables.
The second table has a one-to-many relationship with the first table.

I have a button which is intended to copy the key value from the second table to the first.

This button works when the second table is arranged into the form as a subform, but I do not need to see the entire default subform.

I only need a small subset of the fields from the subform.

Attempts:
1) The button does not work if I hide the subform and add in linked text boxes. The text box as well does not link to the subform.
2) The button does not work if I simply add the desired fields at text boxes with the 'Add Existing Fields' tool from the design tab.

As I understand the problem now, it is an issue of getting my field reference(s) to work correctly in the button's VB code:

Example-1)

Private Sub Command34_Click()
'INSERT CURRENT ARRAY ID.

Me.[ARRAY_ID_ARRAYS].SetFocus

DoCmd.GoToRecord , , acLast

Me![ARRAY_ID] = Me.[ARRAY_ID_ARRAYS]

Me!NOTES.SetFocus

End Sub

Example-2)

Private Sub Command34_Click()
'INSERT CURRENT ARRAY ID.

Forms![CLEAN DATA]![ARRAY_ID_ARRAYS].SetFocus

DoCmd.GoToRecord , , acLast

Me![ARRAY_ID] = Forms![CLEAN DATA]![ARRAY_ID_ARRAYS]

Me!NOTES.SetFocus

End Sub

I am using MS ACCESS 2007 on Windows XP.

Motivation:
I am a deep SAS user, but building forms in SAS is too time consuming and often clients lack the software. Being able to push ACCESS onto SharePoint and websites looks 'easier' as well. So I am now learning 'yet another software'.

Thank you,
Hal
Mar 12 '08 #1
3 1326
Stewart Ross
2,545 Expert Mod 2GB
Hi HopeHal. For me at least your post is proving difficult to understand; the most basic concern for me is if there is a one-to-many relationship already in existence between two tables, why do you need to copy the key back from the many side to the one side? If Access has been set to enforce relational integrity it simply won't let you have a secondary key value in a many-side table with no one-side primary key to match.

Leaving this to one side, you haven't told us anything about the fields in the tables, and which fields you are referring to in your code. Without that it is difficult to advise you on how to get what you need to do done. It is not at all clear what the field you refer to as an array is; if it is the subform you are not referring to any of its controls in either example. If it is a textbox, what is its source?

I would be happy to help, as I am sure would other contributors, but you really do need to provide some clarification to help us to understand your problem, and in turn to help you.

Regards

Stewart
Mar 13 '08 #2
Thanks for your patience! Seems that I do not yet have the appropriate vocabulary.

Big picture:
The purpose of the form is to clean and organize a raw data set for future analysis in another software. The data set to be cleaned has 12000+ variables in 21 topic sections. The form displays the variables one at a time and the 'data janitor' (usually me...) assigns and checks characteristics for each variable. This work is largely automated with buttons. When one of the 21 sections is completed, the data is read by SAS for statistical analysis and modeling.

Why more than one table:
The main table is the one with 12K variables (Tabl1). The second table (Tbl2) is related to Tbl1with a one-to-many numeric key. Large collections of variables within a topic are further sub-grouped into a text string on Tbl2, hence one row in Tbl2 represents many rows in Tbl1; This Tbl2 text string is simply an array of the sub-grouped variables in SAS programing syntax. When a new row on Tbl2 is created, this key value needs to be placed in Tbl1 and when a new variable name is added to this text string the Tabl2 key needs to be placed in the corresponding Tbl1 variable row.

What works:
Everything works when Tbl2 is placed on the form as a subform. Everything reads into SAS with great success.

What does not work:
The subform is a spreadsheat and it is very cumbersome to view and use. Why not just have a text boxes on my form for the three Tbl2 fields needed on the form instead of the whole clunky subform Tbl2 spreadsheet? The whole idea is to improve worker efficiency.

I think we communicated successfully here:
"If it is a textbox, what is its source?" Yes, this is my question! How do I source the text boxes from Tbl2?

If this big picture description of the problem is adequate, I can reply with the ACCESS coding details. Please suggest specifics.

Thanks!
Mar 13 '08 #3
Stewart Ross
2,545 Expert Mod 2GB
Thanks for your clarification, HopeHal. You have indeed made things much clearer.

It can be difficult to go from a free-form data analysis table to a relational database, because the applications of these products are so entirely different. Relational databases model relationships between objects; free-form tables hide the objects with the ease of simply adding additional columns of data. It makes true relational analysis of existing analytical tables a daunting task, as the deconstruction of the implicit relationships can be very time consuming.

Please feel free to post your code. I would also welcome a list of the essential fields you need to access within the spreadsheet-like table, as this is clearly one of the key items you need to be able to connect to and use in your application.

-Stewart
Mar 13 '08 #4

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

Similar topics

2
by: Hawk | last post by:
I have a custom menu control that I am creating using C#. I am rendering HTML from a StringBuilder in my control to add the needed JavaScript to the HTML output. I need to have the JavaScript...
1
by: Jon Stranger | last post by:
I am trying to build a custom web control based on DataGrid using VS.NET Standard Edition and have a problem referencing the Columns collection. The control has been built in a separate VS.NET...
4
by: Ron | last post by:
I need to write a custom textbox control that references an object located in the Global.asax class, but I can't compile the control into a DLL without including the reference to the project DLL...
2
by: Joey | last post by:
Hi There, I am trying to get the selected value of a listbox when I click a button, everything works ok and I can bind the list and when I have a basic page and click a button to invoke a sub it...
3
by: markh | last post by:
Does anyone know where i could find a good website that explains many techniques for direct control referencing? thanks markh
3
by: Mike Jakes | last post by:
I hope that someone can offer a little advice on this one - I've searched the group but can't find an answer. I think that I'm doing something really stupid or missing something trivial, but see...
0
by: jobs | last post by:
Given the Gridview below: When I select the button "Rate" and fall into this code: How can I reference "carriercode" and other . Apparently selecting the button does not select the row. I've...
1
by: jobs | last post by:
Given the Gridview below: When I select the button "Rate" and fall into this code. How can I reference "carriercode" and others . Apparently selecting the button does not select the row. I've...
3
by: oozy | last post by:
Hi, I'm currently using Page.Form.DefaultButton = ChangePassword1.FindControl("xx").UniqueID to set my DefaultButtons in a form that has multiple wizards(each in it's own panel). I can...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.