473,804 Members | 4,005 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Editing form-bound records with DAO (Access 97)

Hi,

I'm trying to check for a unique value index violation on a bound
field when done editing the field (before update, on exit, on lost
focus, etc), and when I find a violation change the value to the
default "filler" value (after a warning).

The problem is that Access considers the record locked by the bound
control(s), so I can't edit it using DAO. I've tried setting focus to
other non-bound controls, but this doesn't seem to work. I need a way
to force Access to release the record bound to the controls so I can
edit it with DAO. Any suggestions? Ideally there would be something
equivilant to Update in DAO, but I haven't found anything.

Thanks
Nov 13 '05 #1
1 1768
You want to test the value in a bound control, and alter it if it's not
suitable?

Use the AfterUpdate event of the control. You can assign a different value
in that event.

If you are actually getting engine-level messages before you can get out of
the control, you would need to use the Error event of the form.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"DrFoo" <ar*@bc.com> wrote in message
news:qo******** *************** *********@4ax.c om...
Hi,

I'm trying to check for a unique value index violation on a bound
field when done editing the field (before update, on exit, on lost
focus, etc), and when I find a violation change the value to the
default "filler" value (after a warning).

The problem is that Access considers the record locked by the bound
control(s), so I can't edit it using DAO. I've tried setting focus to
other non-bound controls, but this doesn't seem to work. I need a way
to force Access to release the record bound to the controls so I can
edit it with DAO. Any suggestions? Ideally there would be something
equivilant to Update in DAO, but I haven't found anything.

Thanks

Nov 13 '05 #2

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

Similar topics

2
1227
by: Ryan | last post by:
I have an SP which I use to insert into a table data from another. For example... INSERT INTO myWorkTable (Field1, Field2) SELECT myField1, myField2 FROM
0
1617
by: Max | last post by:
Hi, I am having problem with missing default values in Linked Sql Server 2000 table. When I open table defination in Access it doesn't show the default value. And they don't show in bound form too. If I open the table design in Sql Server I can see the default value. Pls help.... Thanks in advance
3
13979
by: Anthony Kroes | last post by:
I have a subform on a form and they are not linked. On the main form is a text box where the user types in a number. When that number changes, I have some code to make the corresponding text field in the subform default its value so that the next record created uses the value from the box on the main form. So far so good - works fine. What I also need to do at the same time is change all *existing* records on the subform to that same...
1
2171
by: Shaun | last post by:
Hi all Ok here is the big question, have a form that was bound to a now large database (Access 2002 client / server split) and I was accessing various records based on using applyfilter. Now to me that became ineffiecnt as I assume the client would request the entire dataset over the LAN and apply the filter locally, is this true? What I then tested was to bind the form to a query, that query has the key referring to a hidden field on the...
2
1488
by: MLH | last post by:
I have a form frmEditAdminData. Its AllowAdditions property is set to No. I thought this meant the form could not be opened in a manner that allowed the appending of new records to its source table. But that is untrue. I open the form from code this way: DoCmd.OpenForm "frmEditAdminData", , , , acFormEdit How can I prevent the addition of records to the source
4
2786
by: Jim | last post by:
I have a form that is using a query for the control source. The query put the data in order of TOP 20. I've added an extra textbox in the form and want to be able to automatically rank the records and award points for the top averages. what would be the best approach to assigning values according to the ranking? Thanks in advance.
3
6199
by: KayC | last post by:
Hi Background info: I am running Access 2000 I have a form bound to a blank table When a user clicks a button the form opens in datasheet view User enters data into form and closes form User clicks button which then creates an inner join between form bound table and master table and updates records in master table where values are equal to form bound table
0
1557
by: eighthman11 | last post by:
Access 2000. Sql Server I know this is going to sound crazy but I have a continuous form which is bound to a sql table with an ODBC connection. I filter the records in the Continous form based on the selection from the previous form. At first moving through the records using the scroll bar on the right was slow. I placed an option button on the continous form which filtered the data to only show records that had a
0
3138
by: Yarik | last post by:
Hello, Here is a sample (and very simple) code that binds an Access 2003 form to a fabricated ADO recordset: ' Create recordset... Dim rs As ADODB.Recordset: Set rs = New ADODB.Recordset ' Append one or more fields... Call rs.Fields.Append("Number", adInteger)
0
9579
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7616
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4297
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3816
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.