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

Problem pasting to a sub form with a SQL 2003 Back End

Hi,
I have an application which uses Access 2003 as both the FE and the BE.
However, for a number of good reasons, I am in the process of
converting the BE to SQL server 2003. I am not converting the FE to
ADP, I am simply linking the tables using ODBC. I have overcome a
number of isues and it is working quite nicely, however I do have an
issue with a sub form.

I have a main form with two sub forms. I can enter text directly into
the sub forms and it works fine, as I would expect. However, I need to
be able to copy a number of lines from one sub form, and paste them
into the other (both sub forms have exactly the same field names and
types, but they are based on different tables). When I do this, every
field in the second sub form (i.e. the one i am pasting to) is
displayed as #Deleted, yet if I close the main form and go back in, it
has pasted successfully, and all the lines are displayed.

This works fine with the Access 2003 BE. Can anybody suggest a reason
why this might be happening? I did have some code on the BeforeInsert
event of the sub form which I thought might have been causing it, but I
have taken that out and it is still happening.

Thanks for any advice,

Colin

Dec 11 '06 #1
3 1683
Likely you have an Autonumber (SQL Server "identity" field) as the key...
and in many cases, one of which you have encountered, ODBC does not
automatically receive the newly created identity field and return to the
Form for display. I've never encountered the situation you describe, because
having multiple tables with the same content is almost certainly indicative
of an "unnormalized" design. There are exceptions, but they are rare... I'd
repeat with emphasis, _rare_. You might be able to do what you want with
VBA code...

With some other server DBs, we found it useful to write a Stored Procedure
that would obtain for us the next key in sequence for a table, and update
the table-of-tables. Thus we didn't use the server's identity field
capability. When we moved some applications to MS SQL Server, we found that
worked very well there, too.

Short of a discussion on what you are accomplishing with the two tables with
identical data, and how that could be done differently, I think perhaps you
may need to create a similar Stored Procedure, and copy the data into the
other table using code.

Larry Linson
Microsoft Access MVP
"Bobby" <bo****@blueyonder.co.ukwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
Hi,
I have an application which uses Access 2003 as both the FE and the BE.
However, for a number of good reasons, I am in the process of
converting the BE to SQL server 2003. I am not converting the FE to
ADP, I am simply linking the tables using ODBC. I have overcome a
number of isues and it is working quite nicely, however I do have an
issue with a sub form.

I have a main form with two sub forms. I can enter text directly into
the sub forms and it works fine, as I would expect. However, I need to
be able to copy a number of lines from one sub form, and paste them
into the other (both sub forms have exactly the same field names and
types, but they are based on different tables). When I do this, every
field in the second sub form (i.e. the one i am pasting to) is
displayed as #Deleted, yet if I close the main form and go back in, it
has pasted successfully, and all the lines are displayed.

This works fine with the Access 2003 BE. Can anybody suggest a reason
why this might be happening? I did have some code on the BeforeInsert
event of the sub form which I thought might have been causing it, but I
have taken that out and it is still happening.

Thanks for any advice,

Colin

Dec 11 '06 #2

Larry Linson wrote:
Likely you have an Autonumber (SQL Server "identity" field) as the key...
and in many cases, one of which you have encountered, ODBC does not
automatically receive the newly created identity field and return to the
Form for display. I've never encountered the situation you describe, because
having multiple tables with the same content is almost certainly indicative
of an "unnormalized" design. There are exceptions, but they are rare... I'd
repeat with emphasis, _rare_. You might be able to do what you want with
VBA code...

With some other server DBs, we found it useful to write a Stored Procedure
that would obtain for us the next key in sequence for a table, and update
the table-of-tables. Thus we didn't use the server's identity field
capability. When we moved some applications to MS SQL Server, we found that
worked very well there, too.

Short of a discussion on what you are accomplishing with the two tables with
identical data, and how that could be done differently, I think perhaps you
may need to create a similar Stored Procedure, and copy the data into the
other table using code.

Larry Linson
Microsoft Access MVP

Thanks Larry,
I'll take a look at some of the points you have raised. Just to clear
up one point, the tables don't hold the same data, they just have some
of the same fields. One table is a Purchase Order table, the other is a
Returned Items table. The two sub forms use the same fields from each
table, and I use copy and paste between the two as an easy way for the
user to select which items are being returned, but both tables have
other fields which are more specific to the data which they hold.

Thanks again

Colin

Dec 12 '06 #3

Bobby wrote:
Hi,
I have an application which uses Access 2003 as both the FE and the BE.
However, for a number of good reasons, I am in the process of
converting the BE to SQL server 2003. I am not converting the FE to
ADP, I am simply linking the tables using ODBC. I have overcome a
number of isues and it is working quite nicely, however I do have an
issue with a sub form.

I have a main form with two sub forms. I can enter text directly into
the sub forms and it works fine, as I would expect. However, I need to
be able to copy a number of lines from one sub form, and paste them
into the other (both sub forms have exactly the same field names and
types, but they are based on different tables). When I do this, every
field in the second sub form (i.e. the one i am pasting to) is
displayed as #Deleted, yet if I close the main form and go back in, it
has pasted successfully, and all the lines are displayed.

This works fine with the Access 2003 BE. Can anybody suggest a reason
why this might be happening? I did have some code on the BeforeInsert
event of the sub form which I thought might have been causing it, but I
have taken that out and it is still happening.

Thanks for any advice,

Colin
Ok, I finally resolved this issue. After a lot of work trying various
solutions such as using VBA and temporary tables etc., I resolved it by
accident. I refreshed the ODBC link for the table the form was using,
and it worked immediately.

I am quite confident that this was the answer, because I had an
identical problem with another form, and so went straight to refresh
the link, and it worked again.

Oh well, you live and learn,

Thanks

Colin

Dec 14 '06 #4

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

Similar topics

4
by: Stephan & Saori | last post by:
I found a "weird" problem running windows 2003 Server. Maybe it's a know problem but I just wanted to make sure everyone knows. When running explorer to find the directories on my hard disk. It's...
12
by: Tom | last post by:
Hi all, I am a newbe to javascript so I could use your help. I checked the FAQs and searched google but I could not resolve this problem. My form is as follows: <form...
3
by: Dr Twin via AccessMonster.com | last post by:
Hello to all I have a huge problem with Access 2003 with SP1, installed on WinXP Pro SP2 with all the current updates. I've tried everything including installing Office again, and again and...
0
by: Ratan | last post by:
I am having an C# .Net application which using WinInet api for FTP downloads and its running fine on win 2000 and win xp but giving problem on win 2003 server. It seems to be failing to...
3
by: Brett | last post by:
How do I get the default VS.NET form icon back after changing icons? Thanks, Brett
1
by: riscy | last post by:
I'm having odd behaviour of VS 2003 pro recently. It happen when Dell 9200 returned from repairs with new motherboard to fix audio out socket problem (as they say). I installed Visual Assist X and...
6
by: Bobby | last post by:
Hi, I'm not 100% sure that this is an Access problem. A friend of mine has an Access 2003 database. Occasionally he brings a copy to me so that I can import some of his data into my Access 2003...
5
by: wassimdaccache | last post by:
Dear All ; I would like to plant my inbox from MS OUTLOOK 2003 into an access form (2003). Any IDEA for doing would be greatly appreciated. Regards
1
by: marciojersey | last post by:
Hi everyone. I'm having a problem with form opacity in my c# application. I have a window with a vrml viewer com control and whenever the window goes into layered mode, the vrml viewer is rendered...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
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,...
0
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...
0
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,...

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.