473,626 Members | 3,947 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Quick Question

I'm sure that to most of you this will be an easy answer but to me it
isn't so here goes..

I have a database that I want to export a table from into Excel format
so that I can use it on my palmtop. I don't want all of the data in the
table - just current members details (I allready have a query to show
only current members that is used in a number of other places in the
database).

I can manage to export the data to an excel file and view through excel
but I also want to be able to make aditions/changes to the data while
away from my PC (using the palmtop) and then import the data back to the
main database.

I've seen how to import data into a current table but when I try to
import the data back to the table it won't allow me to do so because it
creates multiple primary keys.

How can I export the information from the table to excel and then back
again after making changes?

Any suggestions welcomed.
--
Chris Naylor
Remove your trousers to reply
http://www.neff.org.uk
http://www.ireland2006eb.org.uk/

"No point in making a molehill out of an elephant!"
Nov 13 '05 #1
11 1862
So, what you really need is a way to synchronize an Excel spreadsheet
with an Access table. I don't think this exists, outside of what you might
write for yourself in code, and then the rules would have to be defined.
It's not a trivial task, but could probably be done.

For example, you'll need to figure out how to determine which record
is the most recent. If changes occur on the palmtop and the Access table,
even if done to different records, the records need to be merged, not
replaced in Access. If, however, you assume that the Access table isn't
changed while you make changes in the Excel doc, then it's easy and you
only need to loop through and update Access.

I'm not being clear here, but basically, one would need to know more about
the way it's used in order to devise a plan. Below is some code I used
recently to compare two similar datasets, looking for differences. In my
case, I dumped differences to a table. What you need isn't far from this.

Danny J. Lesandrini
dl*********@hot mail.com
http://amazecreations.com/datafast/

Public Function ComparePatientD ata()
On Error GoTo Err_Handler
Dim dbs As DAO.Database
Dim rstList As DAO.Recordset
Dim rstItem As DAO.Recordset
Dim intField As Integer
Dim fldItem As DAO.Field
Dim strSQL As String
Dim strCode As String
Dim lngNum As Long
Dim FUDate As Date
Dim StartDate As Date
Set dbs = CurrentDb

strSQL = "SELECT * FROM tblAdverseEvent ORDER BY [PatientCode], [AENumber], [StartDate]"
Set rstList = dbs.OpenRecords et(strSQL, dbOpenSnapshot)

Do Until rstList.EOF
strCode = Nz(rstList!Pati entCode, "???")
lngNum = Nz(rstList!AENu mber, 0)
StartDate = Nz(rstList!Star tDate, 0)
'FUDate = Nz(rstList!Foll owUpDate, Date)

strSQL = "SELECT * FROM tblAdverseEvent s_Old WHERE [PatientCode] = '" & strCode & "' AND [AENumber]=" & lngNum & "
AND [StartDate]=#" & StartDate & "#"
Set rstItem = dbs.OpenRecords et(strSQL, dbOpenSnapshot)

If Not rstItem.BOF And Not rstItem.EOF Then
For intField = 1 To rstList.Fields. Count - 1
If Trim(rstList.Fi elds(intField)) <> Trim(rstItem.Fi elds(intField)) Then
strSQL = "INSERT INTO 817Exceptions (PatientCode, Key, TableName, FieldName, NewValue, OldValue) VALUES
('" & strCode & "','" & lngNum & " : " & StartDate & "','tblAdverseE vent','" & _
rstList.Fields( intField).Name & "','" & Replace(rstList .Fields(intFiel d).Value, "'", "''") &
"','" & Replace(rstItem .Fields(intFiel d).Value, "'", "''") & "')"
dbs.Execute strSQL
End If
Next
End If
rstList.MoveNex t
Loop

MsgBox "Done"

exit_Here:
Set rstList = Nothing
Set rstItem = Nothing
Set dbs = Nothing
Exit Function

Err_Handler:
MsgBox Err.Description
Resume Next

End Function

--

"Chris Naylor" <ne************ **@pobice.com> wrote ...
I'm sure that to most of you this will be an easy answer but to me it
isn't so here goes..

I have a database that I want to export a table from into Excel format
so that I can use it on my palmtop. I don't want all of the data in the
table - just current members details (I allready have a query to show
only current members that is used in a number of other places in the
database).

I can manage to export the data to an excel file and view through excel
but I also want to be able to make aditions/changes to the data while
away from my PC (using the palmtop) and then import the data back to the
main database.

I've seen how to import data into a current table but when I try to
import the data back to the table it won't allow me to do so because it
creates multiple primary keys.

How can I export the information from the table to excel and then back
again after making changes?

Any suggestions welcomed.
--
Chris Naylor
Remove your trousers to reply
http://www.neff.org.uk
http://www.ireland2006eb.org.uk/

"No point in making a molehill out of an elephant!"

Nov 13 '05 #2
In article <RP************ ********@comcas t.com>,
(dl*********@ho tmail.com) muttered something along the lines of ...
So, what you really need is a way to synchronize an Excel spreadsheet
with an Access table. I don't think this exists, outside of what you might
write for yourself in code, and then the rules would have to be defined.
It's not a trivial task, but could probably be done.

For example, you'll need to figure out how to determine which record
is the most recent. If changes occur on the palmtop and the Access table,
even if done to different records, the records need to be merged, not
replaced in Access. If, however, you assume that the Access table isn't
changed while you make changes in the Excel doc, then it's easy and you
only need to loop through and update Access.

I'm not being clear here, but basically, one would need to know more about
the way it's used in order to devise a plan. Below is some code I used
recently to compare two similar datasets, looking for differences. In my
case, I dumped differences to a table. What you need isn't far from this.

<snip code>

Right, bit more explanation then...

The database is only used by me to keep track of Cubs details and awards
etc. This lives on my home PC. I want a way to take a particular table
from the database (Cub Details) and view/edit on my PDA. No changes will
be made to database on PC while changes are made/updated on PDA.

I'm not very good when it comes to coding - most of my database building
is pretty basic.

--
Chris Naylor
Remove your trousers to reply
http://www.neff.org.uk
http://www.ireland2006eb.org.uk/

An optimist is someone who thinks the future is uncertain.
Nov 13 '05 #3
Add a field to your table called "ExportedToPDA" . In your export procedure
set this field to True for all the records in your export. In your import
procedure, first delete all the records on your PC where ExportToPDA is
marked True. Then import (append) the records on your PDA.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdata sheet.com
www.pcdatasheet.com

If you don't get the help you need in the newsgroup, I can help you for a
very reasonable fee.
Over 1000 Access users have come to me for help.
Remember that a lone man built the Ark. A large group of professionals built
the Titanic.

"Chris Naylor" <ne************ **@pobice.com> wrote in message
news:MP******** *************** *@news.individu al.net...
I'm sure that to most of you this will be an easy answer but to me it
isn't so here goes..

I have a database that I want to export a table from into Excel format
so that I can use it on my palmtop. I don't want all of the data in the
table - just current members details (I allready have a query to show
only current members that is used in a number of other places in the
database).

I can manage to export the data to an excel file and view through excel
but I also want to be able to make aditions/changes to the data while
away from my PC (using the palmtop) and then import the data back to the
main database.

I've seen how to import data into a current table but when I try to
import the data back to the table it won't allow me to do so because it
creates multiple primary keys.

How can I export the information from the table to excel and then back
again after making changes?

Any suggestions welcomed.
--
Chris Naylor
Remove your trousers to reply
http://www.neff.org.uk
http://www.ireland2006eb.org.uk/

"No point in making a molehill out of an elephant!"

Nov 13 '05 #4
If the ID field is an autonumber, you can't delete the record. If the
record exists, and needs to be updated, it will require an Update
statement.

It would be difficult to explain all the steps, but if you could post
the fields in your table, that would be a start. You'll probably need
to write some code, but most of the work can be done with queries.

--

Danny J. Lesandrini
dl*********@hot mail.com
http://amazecreations.com/datafast/

"PC Datasheet" <no****@nospam. spam> wrote ...
Add a field to your table called "ExportedToPDA" . In your export procedure set this field to True for all the records
in your export. In your import procedure, first delete all the records on your PC where ExportToPDA is marked True.
Then import (append) the records on your PDA.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdata sheet.com
www.pcdatasheet.com

If you don't get the help you need in the newsgroup, I can help you for a very reasonable fee.
Over 1000 Access users have come to me for help.
Remember that a lone man built the Ark. A large group of professionals built the Titanic.

"Chris Naylor" <ne************ **@pobice.com> wrote in message news:MP******** *************** *@news.individu al.net...
I'm sure that to most of you this will be an easy answer but to me it
isn't so here goes..

I have a database that I want to export a table from into Excel format
so that I can use it on my palmtop. I don't want all of the data in the
table - just current members details (I allready have a query to show
only current members that is used in a number of other places in the
database).

I can manage to export the data to an excel file and view through excel
but I also want to be able to make aditions/changes to the data while
away from my PC (using the palmtop) and then import the data back to the
main database.

I've seen how to import data into a current table but when I try to
import the data back to the table it won't allow me to do so because it
creates multiple primary keys.

How can I export the information from the table to excel and then back
again after making changes?

Any suggestions welcomed.
--
Chris Naylor
Remove your trousers to reply
http://www.neff.org.uk
http://www.ireland2006eb.org.uk/

"No point in making a molehill out of an elephant!"


Nov 13 '05 #5
Danny,

Why can't you delete a record that has a primary key that is autonumber?
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdata sheet.com
www.pcdatasheet.com

If you don't get the help you need in the newsgroup, I can help you for a
very reasonable fee.
Over 1000 Access users have come to me for help.
Remember that a lone man built the Ark. A large group of professionals built
the Titanic.

"Danny J. Lesandrini" <dl*********@ho tmail.com> wrote in message
news:RI******** ************@co mcast.com...
If the ID field is an autonumber, you can't delete the record. If the
record exists, and needs to be updated, it will require an Update
statement.

It would be difficult to explain all the steps, but if you could post
the fields in your table, that would be a start. You'll probably need
to write some code, but most of the work can be done with queries.

--

Danny J. Lesandrini
dl*********@hot mail.com
http://amazecreations.com/datafast/

"PC Datasheet" <no****@nospam. spam> wrote ...
Add a field to your table called "ExportedToPDA" . In your export
procedure set this field to True for all the records in your export. In
your import procedure, first delete all the records on your PC where
ExportToPDA is marked True. Then import (append) the records on your PDA.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdata sheet.com
www.pcdatasheet.com

If you don't get the help you need in the newsgroup, I can help you for a
very reasonable fee.
Over 1000 Access users have come to me for help.
Remember that a lone man built the Ark. A large group of professionals
built the Titanic.

"Chris Naylor" <ne************ **@pobice.com> wrote in message
news:MP******** *************** *@news.individu al.net...
I'm sure that to most of you this will be an easy answer but to me it
isn't so here goes..

I have a database that I want to export a table from into Excel format
so that I can use it on my palmtop. I don't want all of the data in the
table - just current members details (I allready have a query to show
only current members that is used in a number of other places in the
database).

I can manage to export the data to an excel file and view through excel
but I also want to be able to make aditions/changes to the data while
away from my PC (using the palmtop) and then import the data back to the
main database.

I've seen how to import data into a current table but when I try to
import the data back to the table it won't allow me to do so because it
creates multiple primary keys.

How can I export the information from the table to excel and then back
again after making changes?

Any suggestions welcomed.
--
Chris Naylor
Remove your trousers to reply
http://www.neff.org.uk
http://www.ireland2006eb.org.uk/

"No point in making a molehill out of an elephant!"



Nov 13 '05 #6
In article <H0************ **@newsread3.ne ws.atl.earthlin k.net>,
(no****@nospam. spam) muttered something along the lines of ...
Danny,

Why can't you delete a record that has a primary key that is autonumber?

It won't let me delete records because they are linked to other records
in other tables.

The table in question has rather a lot of field names, I don't actually
need all of them to be exported.

The fields I do need to export and change are:

FirstName, LastName, Guardian, PhoneNumber, Six and a load more fields
that contain either a y/n answer or a date. In all there are about 50
that I need to export.

Would it be easier for me to post a copy of the DB somewhere (minus
current data for obvious reasons)?

I'm beginning to think that it might just be a better idea to export the
files I need and then update the database manually as and when I need
to, but if I can automate it then it saves time - if it involves writing
code then I haven't really got that much of and idea on coding.
Cheers

--
Chris Naylor
Remove your trousers to reply
http://www.neff.org.uk
http://www.ireland2006eb.org.uk/

Men do not like to admit to even momentary imperfection. My husband
forgot the code to turn off the alarm. When the police came, he wouldn't
admit he'd forgotten the code.....he turned himself in. - Rita Rudner
Nov 13 '05 #7
"Chris Naylor" <ne************ **@pobice.com> wrote in message
news:MP******** *************** *@news.individu al.net...
I'm sure that to most of you this will be an easy answer but to me it
isn't so here goes..

I have a database that I want to export a table from into Excel format
so that I can use it on my palmtop. I don't want all of the data in the
table - just current members details (I allready have a query to show
only current members that is used in a number of other places in the
database).

I can manage to export the data to an excel file and view through excel
but I also want to be able to make aditions/changes to the data while
away from my PC (using the palmtop) and then import the data back to the
main database.

I've seen how to import data into a current table but when I try to
import the data back to the table it won't allow me to do so because it
creates multiple primary keys.

How can I export the information from the table to excel and then back
again after making changes?

Is the data in the Access table changing whilst your changing it in Excel?
If not then an update query might suffice.

Regards,
Keith.
www.keithwilby.com
Nov 13 '05 #8
You have Referential Integrity enforced but you don't have Cascade Delete.
You could go to yout tables and check Cascade Delete and then you would be
able to delete the records. However you are also going to delete the records
in the cascade so you got to make provisions to preserve those records and
replace them at the time you do your import.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdata sheet.com
www.pcdatasheet.com

If you don't get the help you need in the newsgroup, I can help you for a
very reasonable fee.
Over 1000 Access users have come to me for help.
Remember that a lone man built the Ark. A large group of professionals built
the Titanic.

"Chris Naylor" <ne************ **@pobice.com> wrote in message
news:MP******** *************** *@news.individu al.net...
In article <H0************ **@newsread3.ne ws.atl.earthlin k.net>,
(no****@nospam. spam) muttered something along the lines of ...
Danny,

Why can't you delete a record that has a primary key that is autonumber?

It won't let me delete records because they are linked to other records
in other tables.

The table in question has rather a lot of field names, I don't actually
need all of them to be exported.

The fields I do need to export and change are:

FirstName, LastName, Guardian, PhoneNumber, Six and a load more fields
that contain either a y/n answer or a date. In all there are about 50
that I need to export.

Would it be easier for me to post a copy of the DB somewhere (minus
current data for obvious reasons)?

I'm beginning to think that it might just be a better idea to export the
files I need and then update the database manually as and when I need
to, but if I can automate it then it saves time - if it involves writing
code then I haven't really got that much of and idea on coding.
Cheers

--
Chris Naylor
Remove your trousers to reply
http://www.neff.org.uk
http://www.ireland2006eb.org.uk/

Men do not like to admit to even momentary imperfection. My husband
forgot the code to turn off the alarm. When the police came, he wouldn't
admit he'd forgotten the code.....he turned himself in. - Rita Rudner

Nov 13 '05 #9
If you don't get the help you need in the newsgroup, I can help you for a
very reasonable fee.
Over 1000 Access users have come to me for help.
Remember that a lone man built the Ark. A large group of professionals built
the Titanic.


These 1000 (if at all a real figure..) is only the result of
-- 4 years abusing the newsgroups.
-- 4 years blatantly advertising and job hunting.

You only care about making money, and you act as if the groups are your private hunting ground.
So why would ANYBODY ever trust a person like you and hire you?
*************** *************** *************** ***********

Explanation and more on this answer to Steve:
http://home.tiscali.nl/arracom/stopsteve.html

Arno R
Nov 13 '05 #10

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

Similar topics

0
8266
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
8199
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8365
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
7196
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...
0
5574
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
4198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2626
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
1811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1511
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.