|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
Andy,
Will placing your code in the subforms On Load event work? Forms("frmCompaniesDetail").RecordLocks = 0 lwells |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > Record Locking |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|