Microsoft Access Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft Access Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 9th, 2004, 08:05 AM
aecarpin aecarpin is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 4 aecarpin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 17 sec
Reputation Power: 0
Unhappy Record Locking

Please help!
Can anybody tell me what is wrong with the syntax of the statement below.
I am trying to unlock a record in a query, the data entry is being done through a subform.
The statement work fine like this Forms("frmCompaniesDetail").RecordLocks = 0 when the subform is viewed on its' own.

But the line below does not work when trying to open the subform from the main form, which is what I want to achieve.
Forms("frmMainForm!frmCompaniesDetail").RecordLocks = 0

Please help

Andy

Reply With Quote
  #2  
Old December 9th, 2004, 12:39 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
Andy,

Will placing your code in the subforms On Load event work?

Forms("frmCompaniesDetail").RecordLocks = 0

lwells

Reply With Quote
  #3  
Old December 9th, 2004, 03:53 PM
aecarpin aecarpin is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 4 aecarpin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 17 sec
Reputation Power: 0
lwells
Many thanks, I've tried your suggestion but to no avail.

I get the runtime error 2450: Microsoft Access cant' find the form "frmCompaniesDetail" reffered to in a macro expression or Visual Basic Code.

If I may clarify what I am trying to achieve, well the form "frmCompaniesDetail" is a subform on a tab on the form "frmMainForm". On the "frmCompaniesDetail" Properties Record lock is set to "Edited Record". The aim is to open a form called "frmOutwardTransfer" after a check box on the form "frmCompaniesDetail" is updated (checked) which allow the user to add further information to the same data source as the form "frmCompaniesDetail". It seems that because the form "frmCompaniesDetail" has locked the edited record, editing the same record by another form is not allowed. My work around was to unlock the record "AfterUpdate" (checked) and before the form "frmOutwardTransfer" opens and re-lock it after closing.
I dont' know the right syntax to specify the full form objects level, which is where I believe the problem is. The example I've seem only give one object level.
i.e Forms("formname").RecordLocks = 0. What if there is a subform.

Hope this is helpful.

Andy

Reply With Quote
  #4  
Old December 9th, 2004, 05:12 PM
lwells lwells is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Sep 2004
Posts: 632 lwells User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 21 h 59 m 38 sec
Reputation Power: 5
Hi Andy,

Yes you are correct, you can't edit the same recordset with another form without first saving the record that was just edited.

For example, after you place a check in your check box on your form, you will need to save the record. Then when you open your frmOutwardTransfer you will be able to edit those same records with that form.

Place this type of code before the code that you use to open the form frmOutwardTransfer

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

This will save the current record prior to opening the next form.

See if this helps,
lwells

Reply With Quote
  #5  
Old December 10th, 2004, 12:37 AM
aecarpin aecarpin is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 4 aecarpin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 17 sec
Reputation Power: 0
lwells

How can I thank you, that work beautifully.
It's good to know that there are some great guys out there.

Many thanks

Andy

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft Access Development > Record Locking


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT