A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Saving data



 
 
Thread Tools Display Modes
  #1  
Old April 17th, 2008, 10:52 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 94
Default Saving data

I have a table [Claimant] with controls [SSN], [FirstName], [LastName]

I have 2 forms [ClaimantDetails] and [ClaimDetails]

The control [ClaimDetails]![SSN] has an afterUpdate event to check if
the table [Claimant] contains the same [SSN] if it does, it updates
certain controls in [ClaimDetails]. If the SSN is not found in
[Claimant] table, it opens another form [ClaimantDetails] to create a
new record the the new SSN. After I complete the [FirstName] and
[LastName] controls in [ClaimantDetails], I want it to update the
information in [ClaimDetails] but I keep getting the error "The
Microsoft Jet database engine cannot find a record in the table name
with key matching field(s) name. (Error 3101)"

I know what causes but I cant figure out how to solve it. I tried
DoCmd.Save acForm "ClaimantDetails" before closing it so that it will
update the [Claimant] table. But the recordsource in my half-
completed [ClaimDetails] form does not recognize the new claimant's
SSN is already in the [Claimant] table.

How do I fix this problem? Any help is appreciated.

Thanks,

Sharon
  #2  
Old April 17th, 2008, 11:24 PM posted to microsoft.public.access.forms
Klatuu
external usenet poster
 
Posts: 7,074
Default Saving data

two things
DoCmd.Save acForm "ClaimantDetails"
does not save the data, it saves the current design of the form. For
example, while you had the form open, you changed the Filter property, it
would save the form with the filter property as you set it.

When you close ClaimantDetails, it autmatically adds the new record to the
table. The problem is, the ClaimDetails form doesn't know it. For the new
record to be included in ClaimDetails Recordset, you have to requery the
form. Exactly where that needs to be done, I can't say, because I don't know
enough about the interaction between the two forms.
--
Dave Hargis, Microsoft Access MVP


" wrote:

I have a table [Claimant] with controls [SSN], [FirstName], [LastName]

I have 2 forms [ClaimantDetails] and [ClaimDetails]

The control [ClaimDetails]![SSN] has an afterUpdate event to check if
the table [Claimant] contains the same [SSN] if it does, it updates
certain controls in [ClaimDetails]. If the SSN is not found in
[Claimant] table, it opens another form [ClaimantDetails] to create a
new record the the new SSN. After I complete the [FirstName] and
[LastName] controls in [ClaimantDetails], I want it to update the
information in [ClaimDetails] but I keep getting the error "The
Microsoft Jet database engine cannot find a record in the table name
with key matching field(s) name. (Error 3101)"

I know what causes but I cant figure out how to solve it. I tried
DoCmd.Save acForm "ClaimantDetails" before closing it so that it will
update the [Claimant] table. But the recordsource in my half-
completed [ClaimDetails] form does not recognize the new claimant's
SSN is already in the [Claimant] table.

How do I fix this problem? Any help is appreciated.

Thanks,

Sharon

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:47 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.