Solved

Access frontend with a SQL Server backend

Posted on 2003-11-20
9
2,003 Views
Last Modified: 2007-12-19
I have an MS Access frontend with a SQL Server backend. On several of my forms, I have a textbox bound to the primary key of the table. When the backend was solely in MS Access, the primary key would show up as soon as you start making the record. But this is not the case now that the backend is in SQL. The primary key value doesn't show up until you move off the record and comer back to it.

My problem is that I make use of the primary key value before the user gets off the record, so since it is NULL now - my code is crashing. Is there a solution to this.
0
Comment
Question by:tyy8
9 Comments
 
LVL 32

Expert Comment

by:jadedata
ID: 9788937
Hey tyy8!

 You will have to modify your code somehow to work with this change in MO by the two different databases.
 Is there any other way to identify the record recently entered to return to IT specifically?
regards
Jack
0
 

Author Comment

by:tyy8
ID: 9789705
I need to send the primary key into some other tables, so I need to set that up before the user leaves the record and goes to view those other tables.
0
 
LVL 32

Accepted Solution

by:
jadedata earned 38 total points
ID: 9789733
Set up an SQL trigger on the table to Stick this number into the other table as soon as its available.  The Access code that does this now would then become obsolete because SQL Server would handle it.
0
 

Author Comment

by:tyy8
ID: 9789971
But I also need to send that users ID (for tracking the user's activity), and some other stuff that the trigger would never have available to it.
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 32

Expert Comment

by:jadedata
ID: 9789984
I guess I just don't understand all that is in play here...
0
 
LVL 2

Assisted Solution

by:thorkyl
thorkyl earned 37 total points
ID: 9798989
if me.dirty then me.dirty=false

now the record is saved and you have your key

now you can do what you need to with it.

or as stated above

Create and AFTER INSERT trigger

DECLARE @PK int
AS
@PK=@@IDENTITY
--D0 you your thing using the new key @PK
0
 
LVL 9

Expert Comment

by:ornicar
ID: 10066325
----------------------------------------------------------------------------------------
This question has been abandoned and needs to be finalized.
 You can accept an answer, split the points, or get a refund (information at http:/help.jsp#hs5)
  If you need a moderator to help you, post a question at Community Support (http:/Community_Support/)

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

ornicar
Cleanup Volunteer

---------------------------------------------------------------------------------------------
0
 
LVL 32

Expert Comment

by:jadedata
ID: 10083886
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: jadedata {http:#9789733} & thorkyl {http:#9798989}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jadedata
EE Cleanup Volunteer
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now