快速问题 [英] Quick Question

查看:65
本文介绍了快速问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我相信大多数人这对我来说都是一个简单的答案,但对我而言,这是不是很好......


我有一个数据库,我想将表格导出为Excel格式

,以便我可以在掌上电脑上使用它。我不想要

表中的所有数据 - 只是当前成员的详细信息(我已经有一个查询显示

只有当前成员用于

数据库中其他地方的数量。


我可以设法将数据导出到excel文件并通过excel查看

但我也希望能够在远离我的PC(使用掌上电脑)的情况下对数据进行更改/更改,然后将数据导回到

主数据库。


我已经看过如何将数据导入当前表但是当我尝试将
导入数据回到表中时不允许我这样做,因为它

会创建多个主键。


如何将表中的信息导出到excel然后再返回

在做出更改后会再次出现吗?


欢迎任何建议。

-

Chris Naylor

取下你的裤子回复
http://www.neff.org.uk
http://www.ireland2006eb.org.uk/


否指出用大象制作一个小丘!

解决方案

所以,你真正需要的是一种同步Excel电子表格的方法
带有Access表。我不认为这存在,除了你可能会在代码中为自己写的b $ b $然后必须定义规则。

它是'不是一项微不足道的任务,但可能会完成。


例如,你需要弄清楚如何确定哪一条记录

是最多的最近。如果掌上电脑和Access表发生了变化,即使对不同的记录进行了更改,也需要合并记录,而不是在Access中替换
。但是,如果您认为在Excel文档中进行更改时Access表不会被更改,那么这很容易,而且您只需要
循环并更新Access。


我不清楚这里,但基本上,人们需要了解更多关于

的方式'用于制定计划。下面是我最近使用的一些代码

来比较两个相似的数据集,寻找差异。在我的

案例中,我将差异转移到一张桌子上。你需要的东西离这不远。


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

公共函数ComparePatientData()

错误GoTo Err_Handler

Dim dbs作为DAO.Database

Dim rstList作为DAO.Recordset

Dim rstItem作为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

设置dbs = CurrentDb


strSQL = SELECT * FROM tblAdverseEvent ORDER BY [PatientCode],[AENumber],[StartDate]"

设置rstList = dbs.OpenRecordset(strSQL,dbOpenSnapshot)


Do until rstList.EOF

strCode = Nz(rstList!Pa tientCode," ???")

lngNum = Nz(rstList!AENumber,0)

StartDate = Nz(rstList!StartDate,0)

''FUDat​​e = Nz(rstList!FollowUpDate,Date)

strSQL =" SELECT * FROM tblAdverseEvents_Old WHERE [PatientCode] =''" &安培; strCode& "''和[AENumber] =" &安培; lngNum&

AND [StartDate] =#" &安培; StartDate& "#"

设置rstItem = dbs.OpenRecordset(strSQL,dbOpenSnapshot)


如果不是rstItem.BOF而不是rstItem.EOF则

对于intField = 1到rstList.Fields.Count - 1

如果修剪(rstList.Fields(intField))<>修剪(rstItem.Fields(intField))然后

strSQL =" INSERT INTO 817Exceptions(PatientCode,Key,TableName,FieldName,NewValue,OldValue)VALUES

('' & strCode&"'',''"& lngNum&":"& StartDate&"'','tblAdverseEvent'',''"& _

rstList.Fields(intField).Name&"'',''"& Replace(rstList.Fields(intField).Value,"''","'' ''")&

"'',''"& Replace(rstItem.Fields(intField).Value,"''","'''' ")&"'')"

dbs.Execute strSQL

结束如果

下一页

结束如果

rstList.MoveNext

Loop


MsgBox" Done"


exit_Here:

Set rstList = Nothing

Set rstItem = Nothing

Set dbs = Nothing

退出函数

Err_Handler:

MsgBox Err.Description

继续下一步


结束功能

>
-


" Chris Naylor" <是ne ************** @ pobice.com>写道...

我相信大多数人这对我来说都是一个简单的答案,但对我而言,
并非如此......

我有一个数据库,我想将表格导出为Excel格式
以便我可以在掌上电脑上使用它。我不想要
表中的所有数据 - 只是当前成员的详细信息(我已经有一个查询显示
只有当前成员在
我可以设法将数据导出到excel文件并通过excel查看
但我也希望能够对数据进行更改/更改远离我的电脑(使用掌上电脑),然后将数据导回到主数据库。

我已经看到如何将数据导入当前表但是当我尝试将数据导回到不允许我这样做的表中,因为它创建了多个主键。

如何从中导出信息表格优秀,然后在做出更改后再次返回


欢迎任何建议。
-
Chris Naylor
删除你的裤子回复
http://www.neff.org.uk
< AR el =nofollowhref =http://www.ireland2006eb.org.uk/target =_ blank> http://www.ireland2006eb.org.uk/
没有必要用大象制作一个小丘!



在文章< RP **********中**********@comcast.com> ;,

(dl*********@hotmail.com)嘀咕道...... blockquote class =post_quotes>因此,您真正需要的是一种将Excel电子表格与Access表同步的方法。我不认为这存在,除了你可能在代码中为自己写的东西之外,然后必须定义规则。
这不是一项微不足道的任务,但很可能完成。

例如,您需要弄清楚如何确定哪个记录是最新的。如果掌上电脑和Access表发生了变化,即使对不同的记录进行了更改,记录也需要合并,而不是在Access中替换。但是,如果您认为在Excel文档中进行更改时没有更改Access表,那么它很容易,您只需要循环并更新Access。 br />
我在这里并不清楚,但基本上,人们需要更多地了解
它用于制定计划的方式。下面是我最近使用的一些代码来比较两个相似的数据集,寻找差异。在我的案例中,我将差异转移到了一张桌子上。你需要的东西离这不远。



< snip code>


对,更多解释然后...


数据库仅供我用来跟踪小熊队的详细信息和奖励

等。这些都存在于我的家用电脑上。我想要一种方法从数据库(Cub详细信息)中获取特定的表

并在我的PDA上查看/编辑。在PDA上进行更改/更新时,不会对PC上的数据库进行任何更改。


我在编码方面不是很好 - 我的大部分数据库建筑

非常基本。


-

Chris Naylor

脱下你的裤子回复
http://www.neff.org.uk
http://www.ireland2006eb.org.uk/


乐观主义者认为未来不确定。


在您的表中添加一个名为ExportedToPDA的字段。 。在导出过程中

将导出中的所有记录的此字段设置为True。在您的导入

程序中,首先删除PC上的所有记录,其中ExportToPDA是

标记为True。然后导入(附加)PDA上的记录。


-

PC数据表

您的资源获取访问权限, Excel和Word应用程序
re******@pcdatasheet.com
www.pcdatasheet.com


如果你不是在新闻组中获得您需要的帮助,我可以帮助您支付非常合理的费用。

超过1000个Access用户来找我帮忙。

请记住,一个孤独的人建造了方舟。一大群专业人士建造了泰坦尼克号。$ / b

Chris Naylor <是ne ************** @ pobice.com>在留言中写道

新闻:MP ************************ @ news.individual.ne t ...

我相信大多数人这对我来说都是一个简单的答案,但对我来说这并不是这样的......

我有一个我希望将表格导出为Excel格式的数据库
以便我可以在掌上电脑上使用它。我不想要
表中的所有数据 - 只是当前成员的详细信息(我已经有一个查询显示
只有当前成员在
我可以设法将数据导出到excel文件并通过excel查看
但我也希望能够对数据进行更改/更改远离我的电脑(使用掌上电脑),然后将数据导回到主数据库。

我已经看到如何将数据导入当前表但是当我尝试将数据导回到不允许我这样做的表中,因为它创建了多个主键。

如何从中导出信息表格优秀,然后在做出更改后再次返回


欢迎任何建议。
-
Chris Naylor
删除你的裤子回复
http://www.neff.org.uk
< AR el =nofollowhref =http://www.ireland2006eb.org.uk/target =_ blank> http://www.ireland2006eb.org.uk/
没有必要用大象制作一个小丘!



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!"

解决方案

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*********@hotmail.com
http://amazecreations.com/datafast/

Public Function ComparePatientData()
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.OpenRecordset(strSQL, dbOpenSnapshot)

Do Until rstList.EOF
strCode = Nz(rstList!PatientCode, "???")
lngNum = Nz(rstList!AENumber, 0)
StartDate = Nz(rstList!StartDate, 0)
''FUDate = Nz(rstList!FollowUpDate, Date)

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

If Not rstItem.BOF And Not rstItem.EOF Then
For intField = 1 To rstList.Fields.Count - 1
If Trim(rstList.Fields(intField)) <> Trim(rstItem.Fields(intField)) Then
strSQL = "INSERT INTO 817Exceptions (PatientCode, Key, TableName, FieldName, NewValue, OldValue) VALUES
(''" & strCode & "'',''" & lngNum & " : " & StartDate & "'',''tblAdverseEvent'',''" & _
rstList.Fields(intField).Name & "'',''" & Replace(rstList.Fields(intField).Value, "''", "''''") &
"'',''" & Replace(rstItem.Fields(intField).Value, "''", "''''") & "'')"
dbs.Execute strSQL
End If
Next
End If
rstList.MoveNext
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!"



In article <RP********************@comcast.com>,
(dl*********@hotmail.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.


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******@pcdatasheet.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.individual.ne t...

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!"



这篇关于快速问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆