473,508 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copy Same records

Roy
Hello,
Sorry for a lengthy post.
I develop a access 2000 application.As a part of the daily download,I
import data from a excel sheet into a access table.
The data is as follows:

Task Comments
11801 08/02/2004 07:15:43 CET: Submitted
08/02/2004 06:35:39 CET: Please provide Post Mortem
11804 08/18/2004 09:33:46 CET: Sent mail to Carey Walker chasing
the Post Mortem
08/05/2004 11:18:30 CET: Reassigned to Carey to complete
the post mortem
08/03/2004 14:42:46 CET: Reassigned to John to complete
the PM>
08/02/2004 08:40:52 CET: All Severity 1 problems must
have a post mortem produced and distributed within 24
hours. It is the responsibility of the person producing
the post mortem to send the completed post mortem out to
*GT EU Post Mortems
11805 08/02/2004 09:48:48 CET: Post Mortem completed
08/02/2004 08:49:04 CET: All Severity 1 problems must have
a post mortem produced and distributed within 24 hours. It
is the responsibility of the person producing the post
mortem to send
11815 08/03/2004 03:57:59 CET: All details provided to EDC. EDC
to investigate further.
08/13/2004 13:00:59 CET: All details provided to EDC. EDC
to investigate further.

I want to construct a table duplicating the task number for the
different comments associated with a task number.How to do this in a
query or a module,because this will be a part of a daily routine?
Currently,I am doing this copy and paste manually since the volume is
low but which is expected to go five fold soon.

Thanks,

Roy

Nov 13 '05 #1
3 1660
Roy
Repost!!!
Any workaround or solution to this????

Nov 13 '05 #2
Roy wrote:
Hello,
Sorry for a lengthy post.
I develop a access 2000 application.As a part of the daily download,I
import data from a excel sheet into a access table.
The data is as follows:

Task Comments
11801 08/02/2004 07:15:43 CET: Submitted
08/02/2004 06:35:39 CET: Please provide Post Mortem
11804 08/18/2004 09:33:46 CET: Sent mail to Carey Walker chasing
...
I want to construct a table duplicating the task number for the
different comments associated with a task number.How to do this in a
query or a module,because this will be a part of a daily routine?
Currently,I am doing this copy and paste manually since the volume is
low but which is expected to go five fold soon.

Thanks,

Roy


I couldn't understand your question so I'll just write something :-).

I have a main form with a subform containing line items in datasheet
view. The subform contains a combobox with some common things that
people can choose. In addition to the selections from the combobox
there is a set of standard notes that can be selected. The standard
notes have to be marked with a standard note identifier (not shown) and
must be selected from a list of literal industry standard descriptions.
tblStandardNotes is a local table.

tblStandardNotes
NoteID Auto
PreClickThisNote Y/N
Include Y/N
StandardNote Text

qryStandardNotes
SELECT Include, StandardNote FROM tblStandardNotes

frmSubStandardNotes
RecordSource: qryStandardNotes

frmSubLineItems
RecordSource: SELECT Remarks FROM tblLineItemsLocal ORDER BY
LineItemID;

When the user clicks the option button for general notes, the standard
remarks are shown (in datasheet view also) with some Include boxes
checked. The user can check or uncheck the Include box in the subform.
When they are done selecting standard notes they click the option
button for line items. They can then choose to append all the standard
notes they selected as line items.

'Begin Code behind form-------------------
Private Sub optStandardNotes_Click()
Dim strSQL As String
Dim lngHold As Long

optLineItems.Value = 0
optStandardNotes.Value = -1
'First, set the prechecked items
strSQL = "UPDATE tblStandardNotes SET tblStandardNotes.Include =
[tblStandardNotes].[PreClickThisNote];"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
'Wait a moment
For lngHold = 1 To 1000
DoEvents
Next lngHold
'Now, swap subforms
SubformMain.SourceObject = "frmSubStandardNotes"
End Sub

Private Sub optLineItems_Click()
Dim Response As Variant
Dim strTitle As String
Dim strMessage As String
Dim MyDB As Database
Dim NoteRS As Recordset
Dim strSQL As String
Dim lngI As Long
Dim lngCount As Long

optLineItems.Value = -1
optStandardNotes.Value = 0
strTitle = "Action Confirmation"
strMessage = "Click OK to append the selected notes."
Response = MsgBox(strMessage, vbOKCancel, strTitle)
If Response = vbOK Then
'Add the selected notes
Set MyDB = CurrentDb
strSQL = "SELECT * FROM tblStandardNotes WHERE [Include] = -1"
Set NoteRS = MyDB.OpenRecordset(strSQL, dbOpenSnapshot)
strSQL = "SELECT * FROM tblLineItemsLocal"
Set MyRS = MyDB.OpenRecordset(strSQL, dbOpenDynaset)
If NoteRS.RecordCount > 0 Then
NoteRS.MoveLast
lngCount = NoteRS.RecordCount
NoteRS.MoveFirst
For lngI = 1 To lngCount
MyRS.AddNew
MyRS("Remarks") = NoteRS("StandardNote")
MyRS.Update
If lngI <> lngCount Then NoteRS.MoveNext
Next lngI
End If
NoteRS.Close
Set NoteRS = Nothing
Set MyDB = Nothing
End If
'Now, swap subforms
SubformMain.SourceObject = "frmSubLineItems"
End Sub
'End Code behind form-------------------

I realize that it would have easier to use an Append Query in
optLineItems_Click() but this code is old, it wasn't intended to be
seen by anyone else and I haven't gotten around to changing it yet.
Perhaps you are trying to create a table of distinct tasknumber,
comment pairs that grow daily yet without adding duplicates. Maybe
these ramblings will help you clarify what you are trying to do.

James A. Fortune

Nov 13 '05 #3
rkc
Roy wrote:
I develop a access 2000 application.As a part of the daily download,I
import data from a excel sheet into a access table.
The data is as follows:

Task Comments
11801 08/02/2004 07:15:43 CET: Submitted
08/02/2004 06:35:39 CET: Please provide Post Mortem
11804 08/18/2004 09:33:46 CET: Sent mail to Carey Walker chasing
the Post Mortem
08/05/2004 11:18:30 CET: Reassigned to Carey to complete
the post mortem
08/03/2004 14:42:46 CET: Reassigned to John to complete
the PM>
08/02/2004 08:40:52 CET: All Severity 1 problems must
have a post mortem produced and distributed within 24
hours. It is the responsibility of the person producing
the post mortem to send the completed post mortem out to
*GT EU Post Mortems
11805 08/02/2004 09:48:48 CET: Post Mortem completed
08/02/2004 08:49:04 CET: All Severity 1 problems must have
a post mortem produced and distributed within 24 hours. It
is the responsibility of the person producing the post
mortem to send
11815 08/03/2004 03:57:59 CET: All details provided to EDC. EDC
to investigate further.
08/13/2004 13:00:59 CET: All details provided to EDC. EDC
to investigate further.


There's no way to tell from your post how the sheet is actually
formatted. Are the comments for each task all in one cell or
multiple cells?

I you can't import the data via File, Get External Data,
code could certaily be written to import it via automation.
Couldn't say how without actually seeing it.


Nov 13 '05 #4

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

Similar topics

2
10912
by: news.hp.com | last post by:
I have situation where I need to copy multiple records (only certain fields) from a Rules table to an Events table based on a selection identified in a combo box. When the selection is made in a...
3
8337
by: Tlm | last post by:
Hello All, I have a form (FrmA) with a subform (SubFrmB) embedded in it. SubFrmB also has a subform embedded in it (SubFrmC) The form's recordsource is based on a table (TblA). SubFrmB's...
1
2544
by: Sean Howard | last post by:
Dear All, As is my want I need to do something in Access that seems simple but cannot fathom out. I have main form with two subforms, both datasheets with an almost identical table structure....
2
1825
by: HB2 | last post by:
I use to be able to highlight several records in a table, copy them and paste new records. Now when I right click the records the copy and paste functions are disabled. How do I enable them? ...
19
3442
by: davidgordon | last post by:
Hi, I need some pointers/help on how to do the following if it possible: In my access db, I have the following: Tables: Products, Sub-Assembly, Product-Pack Table, Products
5
1892
by: DraguVaso | last post by:
Hi, I need a SECURE way to copy parts of a file. I'm having files which contains a whole bunch of records. In one 'fysical' file I'm having one or more logical files. What I need to do is to...
0
2130
by: igendreau | last post by:
I have a database with a Header table. Each record in tblHeader has two One-to-Many Relationships: with tblLines and tblKeys. The HeaderID field ties tblHeader to the other two tables. The data...
5
13953
by: Kaur | last post by:
Hi, I have been successful copying a vba code from one of your posts on how to copy and paste a record by declaring the desired fields that needs to be copied in form's declaration and creating two...
2
3445
by: Swinky | last post by:
I hope someone can help...I feel like I'm walking in the dark without a flashlight (I'm NOT a programmer but have been called to task to do some work in Access that is above my head). I have...
5
11090
by: phill86 | last post by:
Hi I have a main form that holds records for scheduled meetings, date time location etc... in that form i have a sub form that has a list of equipment resources that you can assign to the meeting in...
0
7324
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,...
1
7042
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
7495
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
5627
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,...
1
5052
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...
0
3193
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...
0
1556
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 ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
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...

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.