473,594 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Appending? Creating? Help!

Hi

I'm still trying to solve my problem. I have two tables- students and
activity assessments, they're linked one-to-many. From a
lookup/combo/list [however?] I'd like to be able create a series of new
activity assessment records each with the activity name field populated
per student or group of students.

i.e. Bob has no activity assessments but on a form 10 activities (golf,
football etc)are highlighted, click a command button and viola! Bob now
has 10 unique assessment records each with the activity names taken
from the lookup. OR Bob and the rest of his group members are all
automatically given 10 activity assessment records each with the same
activity names - on the click of a button!

Basically- I'm trying to automate the record creation/activity name
data entry procedure rather than having to do it 10 times per student.

Help- thanks

David

PS I'm a novice.
PPS I'll think of a prize for the first correct answer...

Nov 13 '05 #1
6 1311
One way of doing this...

Create a table listing the activities.

Use an Append Query to add records to your table of activity assessments.
The name field is set to whatever the name is.
The Activity field is taken from the table of activities, but only if the
relevant box is ticked.

I assume you will add in the actual assessments manually later...

David

<de********@gma il.com> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
Hi

I'm still trying to solve my problem. I have two tables- students and
activity assessments, they're linked one-to-many. From a
lookup/combo/list [however?] I'd like to be able create a series of new
activity assessment records each with the activity name field populated
per student or group of students.

i.e. Bob has no activity assessments but on a form 10 activities (golf,
football etc)are highlighted, click a command button and viola! Bob now
has 10 unique assessment records each with the activity names taken
from the lookup. OR Bob and the rest of his group members are all
automatically given 10 activity assessment records each with the same
activity names - on the click of a button!

Basically- I'm trying to automate the record creation/activity name
data entry procedure rather than having to do it 10 times per student.

Help- thanks

David

PS I'm a novice.
PPS I'll think of a prize for the first correct answer...

Nov 13 '05 #2
de********@gmai l.com wrote in
news:11******** **************@ g47g2000cwa.goo glegroups.com:
Hi

I'm still trying to solve my problem. I have two tables-
students and activity assessments, they're linked one-to-many.
From a lookup/combo/list [however?] I'd like to be able
create a series of new activity assessment records each with
the activity name field populated per student or group of
students.

i.e. Bob has no activity assessments but on a form 10
activities (golf, football etc)are highlighted, click a
command button and viola! Bob now has 10 unique assessment
records each with the activity names taken from the lookup.
OR Bob and the rest of his group members are all automatically
given 10 activity assessment records each with the same
activity names - on the click of a button!

Basically- I'm trying to automate the record creation/activity
name data entry procedure rather than having to do it 10 times
per student.

Help- thanks

David

PS I'm a novice.
PPS I'll think of a prize for the first correct answer...

I've done something very similar, using two multiselect
listboxes.

Listbox1 contains the student.IDs and student.Names.
Listbox2 contains the activity.IDs and activity.names

the DO_It button runs a little bit of Visual Basic code,
the core part of which is nested for each loops.

'Declarations required, not shown

For each lb1Id in Listbox1.ItemsS elected
For each lb2Id in Listbox2.ItemsS elected
docmd.runsql "INSERT into StudentActiviti es " _
& " (Student.ID, ActivityID) " _
& " VALUES ( " & lb1ID & "," & lb2ID & ")"
next
next

just use the vb help on listboxes to flesh things out.

--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #3
thanks Bob

This is where I've got to with it now:

The code I've got is as follows:
--------------------------------------------------------

Private Sub Command5_Click( )
For Each lb0ID In List0.ItemsSele cted
For Each lb1ID In List2.ItemsSele cted
DoCmd.RunSQL "INSERT into tblAssessmentAc tivityProfile ( [Group
Member ID], [Activity] ) " _
& " VALUES ( " & lb0ID & "," & lb1ID & ")"
Next
Next
End Sub
--------------------------------
It does append a new record into the tblAssessmentAc tivityProfile but
not for the Group Member I select in List0 and rather than append the
activity name from List2 it appends a number. I'm not sure where I'm
going wrong, for a start I don't understand what lb0ID and lb1ID are
and I've checked the help and can't find anything there to enlighten me
on how to proceed.

thanks

David

Nov 13 '05 #4
de********@gmai l.com wrote in
news:11******** **************@ z14g2000cwz.goo glegroups.com:
thanks Bob

This is where I've got to with it now:

The code I've got is as follows:
--------------------------------------------------------

Private Sub Command5_Click( )
For Each lb0ID In List0.ItemsSele cted
For Each lb1ID In List2.ItemsSele cted
DoCmd.RunSQL "INSERT into tblAssessmentAc tivityProfile
( [Group
Member ID], [Activity] ) " _
& " VALUES ( " & lb0ID & "," & lb1ID & ")"
Next
Next
End Sub
--------------------------------
It does append a new record into the
tblAssessmentAc tivityProfile but not for the Group Member I
select in List0 and rather than append the activity name from
List2 it appends a number. I'm not sure where I'm going
wrong, for a start I don't understand what lb0ID and lb1ID are
and I've checked the help and can't find anything there to
enlighten me on how to proceed.

thanks

David

lboID and Lb1Id are just variable names for counters.(I use the
abbreviation for List Box, the listbox # and the suffix ID)
You should dim them as variants.

the Values line should be fleshed out, the numbers you see are
just the row numbers from the listboxes. In a good table design
you would show the student name, but store the student ID and
show the activity name but store the activity ID.

to actually store the names, modify the VALUES section of the
code to something like this:

VALUES ( """ & list0.column(1, lb0ID) & """,""" & list1.column
(1),lb1ID & """)

note the use of triple quotes, because you are now dealing with
text strings,
not that in the column property column(columnnu mber , rownumber)
you should change the 1 to which column is used to hold the name
you want
--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #5
Bob

Here's what I've got now-

------------------
Private Sub Command5_Click( )

Dim lb0ID As Variant
Dim lb2ID As Variant

For Each lb0ID In List0.ItemsSele cted
For Each lb2ID In List2.ItemsSele cted
DoCmd.RunSQL "INSERT into tblAssessmentAc tivityProfile ( [Group
Member ID], [Activity] ) " _
& "VALUES ( """ & List0.Column(1, lb0ID) & """,""" &
List2.Column(2, lb2ID) & """) "

Next
Next
End Sub
-------------------------

It's telling me when I try to append that there is a "type conversion
failure" is this to do with me trying to put a string into the [Group
Member ID] field which is a number type field indexed to the primary
key in the tblGroupMembers ? In terms of the columns- List0 shows the
surnames but it's the ID that's hidden that I want so I'm presuming
that's column 1 and it's the activity name in List2 that I'm after
which I'm assuming is column 2.

thanks again

David

Nov 13 '05 #6
Bob (et al)

I've cracked it thanks! I just had to change the List0 column to 0 and
List2 column to 1 and it now seems to work fine both for one group
member and one activity and for many members and many activities.

Many thanks for your help- now onto the next problem...!

Regards

David

Nov 13 '05 #7

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

Similar topics

6
2264
by: Fnark! | last post by:
I am creating a shopping cart using PHP Version 4.1.2. I am creating and registering a cart object in a session. The cart object contains an array of arrays called $order whose elements are a collection of $orderline associative arrays which, in turn, hold the global POST values key 'order_code' and value 'qty' as passed in from another page. My problem is (shown by using print_r to print out the contents of the arrays) each time I...
1
2106
by: dmiller23462 | last post by:
Hey guys.... I put an error-handling in my page and have it posted at the complete end of the code, see below(when people were putting in 's I was getting the delimiter errors). Great, I understand that now and it seems to be fixed but the data I'm pulling from the HTML fields is not being appended correctly do my Access DB....The field in the DB now reads " ' ". I understand why it does that (my function) but what I need it to read is...
1
2447
by: Jonathan Taylor | last post by:
I have a large XML file, that is too large to read in to XmlDocument. I need to append data to this XML file without creating a new file, since I don't want to have two copies of the large file on the server. I've not seen any example that works so far, even with google. Can anyone help ?
2
3594
by: Cat | last post by:
How do you go about appending data from a dataset to an existing xml file? I know you can use WriteXML but this writes over any data already existing in the specified file.. Cat
2
2234
by: tony.collings | last post by:
I started a thread here : http://groups.google.co.uk/group/microsoft.public.cmserver.general/browse_thread/thread/29d63077144004a9/c3888efdcb7338f6?hl=en#c3888efdcb7338f6 About creating an Email function to email authors when the Review Date has expired on their page. I've managed to now achieve a significant proportion of the work by writing out the details to an XML file and reading them back. However I'm a little stuck on Amending...
0
1541
by: HydroPnik | last post by:
Hi all! What a great community you have here. Being an Access newbie I have already used much information gleaned from the other posters for my current project. I have been tasked with creating a database that will link to a table ("tbl_Data File) located in another database ("Database1"). Changes will be made to a customer record queried from Database1 and saved in a table located in Database2 called "tbl_Instructions". So far I have...
2
1505
by: sarada purkait | last post by:
hii i have to write into a file from the start and then go on appending to it .. i tried using ( ios::out|ios::app) but by this the file keeps on appending every time i run the program and the file ends up containing valuers from the previous runs as well... actually i am using a loop , which generates different values which are to be added to the file . can some1 help me with this i am fairly new to c++
8
2395
by: Michael786 | last post by:
I have two tables. 1 table called T_AddressHistory (Historic Data) and the other called T_Customers (Live Editable Table) I want to append the new changes made to a the T_customers table into the T_AddressHistory. The fields in question are CustomerID, Add1 and Postcode. Example 1 CustomerID = 100001 Add1 = 25 Hope Street
13
3214
by: yueying53 | last post by:
I am new to creating a list of classes. Hence I checked out this website: http://www.daniweb.com/code/snippet390.html. However, I modified the code to check if a class with a particular has been created before. My code works when I create the first class and append it to the list. However, subsequent creations and appending results in this error: "AttributeError: No __call__ method defined." Why is this so? Why does the program from the...
0
7936
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
8241
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...
0
8366
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6646
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5738
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3893
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2383
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
1
1469
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1203
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.