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

tricky form

hello, I'm trying to code a form that will output all data on from one
table into separate pages (can scroll through them using the arrows, or
entering a specific entry at the bottom), but on each page it will look
at the primary key for that table, then look at another table, and
wherever it contains a reference to that particular value, create a
textbox and output a memo onto...

since that was probably vague and confusing i will try to explain it
again with examples... I have a table called "Hazard table", it has
fields for "JSA Number", "Job Component Number", "Hazard Number"
<--(primary key), and "Hazard Description". I have another table called
"Control Measure Table", it has fields for "JSA Number", "Job Component
Number", "Hazard Number" <--(refers to "Hazard number" in "Hazard
table"), "Control Measure Number" <--(primary key), and "Control
Measure Description".

now what I want the form to do, is for each "Hazard Number" in "Hazard
Table" output the description for it, and output any description from
the "Control Measure table" that has a matching "Hazard Number"... I
would like it to display such that it creates a TextBox and displays
the descriptions for each hazard description (with a button at the
bottom to create a new hazard) so that the data can be edited, and then
create TextBoxes to the right of the hazard description, one for each
control desciption (again, with a button at the bottom to create a new
control measure)

the primary keys for both tables are set up as autonumbers, and the
hazard number in the control measure table is supposed to be given the
value of the hazard number its being created with...

currently my chief trouble is figuring out how to access the two tables
and use the relation between the two within the form itself... then i
still havent quite figured out how to have it create the textboxes it
needs as its goes (i dont want to have a bunch of textboxes not visible
or anything like that)... I'm not that good with VB, your help would
be appreciated... thanks in advance, and sorry that my post is long and
a bit hard to read

Jul 12 '06 #1
7 1289
ok, so here is a revised request, since my last was rather... confusing
to say the least...

I am creating a form that will show data from one table, one entry per
page, and on each page it also needs to show data related to that entry
from another table... the data needs to be output into textboxes so
that it can be edited. the number of entries from the related table
associated with the entry from the main table vary, and each entry
needs to be output into a separate textbox. how would i code this so it
would go through a for each loop that looks at all entries in the
second table and, for each entry that has a matching link to main
table, create a textbox and insert the data from the table into it...
at the bottom of the page.

I am also uncertain how to code a button that will adjust the position
of itself and create a new textbox where it had been (whatever data
gets entered into it then needs to be added to the table... im not
certain if some of the fields being autonumbers complicate or simplify
the matter)

I know this is still probably difficult to read and understand, please
ask me questions to clarify and i try to as best as i can

Jul 13 '06 #2
wr***********@gmail.com wrote in
news:11**********************@m73g2000cwd.googlegr oups.com:
ok, so here is a revised request, since my last was rather...
confusing to say the least...

I am creating a form that will show data from one table, one
entry per page, and on each page it also needs to show data
related to that entry from another table... the data needs to
be output into textboxes so that it can be edited. the number
of entries from the related table associated with the entry
from the main table vary, and each entry needs to be output
into a separate textbox. how would i code this so it would go
through a for each loop that looks at all entries in the
second table and, for each entry that has a matching link to
main table, create a textbox and insert the data from the
table into it... at the bottom of the page.

I am also uncertain how to code a button that will adjust the
position of itself and create a new textbox where it had been
(whatever data gets entered into it then needs to be added to
the table... im not certain if some of the fields being
autonumbers complicate or simplify the matter)

I know this is still probably difficult to read and
understand, please ask me questions to clarify and i try to as
best as i can

It sounds like you are trying to reinvent the wheel.

Instead of putting the textboxes directly on the form, create a
subform which contains the textbox.
--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jul 13 '06 #3
the problem is that there is an undetermined amount of textboxes... the
main form will have a number of textboxes, and each of those textboxes
would have a subform which contain a number of textboxes... the number
of textboxes in the main form depends on which record the form as a
whole is looking at, and the number of textboxes in the subform would
depend on which textbox it was associated with... it all varies... i
know i could just manually create all these textboxes, and only make
them visible if there is information to populate them with... but there
could be as many as 10 textboxes in the subform, and as many as 10
textboxes (and therefore 10 subforms) in the main form... of course
there will never be any instance where there are 10 subforms with each
with 10 textboxes... but there will be times when there are 10
subforms, and there will be times when there are 10 textboxes... it
also gets deeper in that the subforms would need to have their own
subform... but im not concerned about that quite yet

It sounds like you are trying to reinvent the wheel.

Instead of putting the textboxes directly on the form, create a
subform which contains the textbox.
--
Bob Quintal
Jul 13 '06 #4
i need to do something sorta like this i suppose...

http://www.tek-tips.com/faqs.cfm?fid=5757

i need to do it in access of course, and instead of just going from
1-10, it needs to look at the database, count the number of entries in
the related table that correspond with the entry in question in the
main table, and create that many textboxes and populate them with the
entries from the related table...

Jul 13 '06 #5
wr***********@gmail.com wrote in
news:11*********************@m79g2000cwm.googlegro ups.com:
the problem is that there is an undetermined amount of
textboxes...
Wrong. the number of textboxes depends on the number of fields
in the underlying table. That is known at design time.

the main form will have a number of textboxes,
and each of those textboxes would have a subform which contain
a number of textboxes...
Wrong. each record in the main table would would have a subform.
The subform can have several rows. Sometimes you can have two
subforms, each related to a different field in the main form.

the number of textboxes in the main
form depends on which record the form as a whole is looking
at, and the number of textboxes in the subform would depend on
which textbox it was associated with... it all varies... i
know i could just manually create all these textboxes, and
only make them visible if there is information to populate
them with... but there could be as many as 10 textboxes in the
subform, and as many as 10 textboxes (and therefore 10
subforms) in the main form... of course there will never be
any instance where there are 10 subforms with each with 10
textboxes... but there will be times when there are 10
subforms, and there will be times when there are 10
textboxes... it also gets deeper in that the subforms would
need to have their own subform... but im not concerned about
that quite yet
>
>It sounds like you are trying to reinvent the wheel.

Instead of putting the textboxes directly on the form, create
a subform which contains the textbox.
--
Bob Quintal


--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jul 13 '06 #6
this still doesnt help me... I understand what you are saying, I just
dont know how to go about implementing something like that...

Jul 13 '06 #7
wr***********@gmail.com wrote in
news:11*********************@s13g2000cwa.googlegro ups.com:
this still doesnt help me... I understand what you are saying,
I just dont know how to go about implementing something like
that...

Perhaps if you showed some sample data it might be easier to
explain.
--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jul 13 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Lars Plessmann | last post by:
Problem: I try to store data in a objects field and read it out again. Sounds easy, yeah. But its a bit tricky here.... ;-) This is the class Customer.php with some setter and getter functions...
15
by: dracolytch | last post by:
Good day all, Ok, I have a pretty tricky problem that I need some help with. I pass around search query information a fair amount (specifically WHERE statements). Normally, I just rawurlencode()...
1
by: Tim | last post by:
Hello, I'm extremely puzzled; I cannot figure out what I'm doing wrong. Here's the situation. I would really appreciate any suggestions. I'm modifying a shopping cart in the following way....
25
by: PyPK | last post by:
What possible tricky areas/questions could be asked in Python based Technical Interviews?
13
by: Steve Jorgensen | last post by:
== On Error Resume next, and Err.Number == If you want to call one of your procedures from another procedure, and check for errors afterward, you mayimagine that you should write code something...
1
by: Pea | last post by:
I'm working with a system usage database. I want to filter out repetitive logins. The query I have retrieves data like this: USER_DATE USER_TIME1 USER_USERID USER_ACCOUNT...
2
by: pruebauno | last post by:
I am currently working on a tricky problem at work. I googled around a bit, but "time intervals" did not come up with anything useful. Although I have some rough idea of how I could solve it, I...
6
by: Bill | last post by:
I'm building a simple file management application using Classic ASP VBScript that has a form to input page content, and file name. After the form is submitted, the application will check to see...
9
by: raylopez99 | last post by:
Just an observation: pens for drawing lines in Win Forms are tricky when assignment is inside the paint handler. inside of the Paint handler, but not inside a "using" brace (that is, outside of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.