472,808 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,808 software developers and data experts.

Controls do not appear to bind to the fields in an empty recordset


i have a form that normally has a Recordset containing only one record bound to it.

i have replaced the navigation buttons with my own and the 'New Record' button assigns an empty Recordset to the form and then uses <recordset>.AddNew to create the new record. the query that i use to obtain the empty recordset (so i bind the controls as normal) is:
"SELECT TFiles.Id AS FileId, TFiles.* FROM TFiles WHERE TFiles.Id=0"

this query is the same as the one to obtain the single record for the form normally. the TFiles.Id field is an autonumber and therefore does not have a 0 value in the records. <recordset>.RecordCount returns 0 for this recordset.

however when i enter the data in the controls and run <recordset>.Update i am given the message:
"Run-time error: 3314

The field 'TFiles.FileRef' cannot contain a Null value because the Required property for this field is set to true. Enter a value in this field."

if i turn set the Required property to 'No' in the table definition for this field the next required field produces the same message.

why do the controls not bind correctly to the fields in the EMPTY recordset??

i came across this error at the following site:

also i have tried using no recordset on the form, but then any bound controls can no longer be referenced in code by their names!! why??

thansk for your help,

Jul 26 '07 #1
2 2283
just to make things worse when i use the .Update method and receive the 3318 rte, the record had actually been entered successfully!

why does this happen? can i just suppress the error messages? and if i do what happens if something else goes wrong and i dont know about it?

thanks again,

Jul 26 '07 #2
14,534 Expert Mod 8TB
Hi Pete

Why is the form bound to a recordset?
Aug 6 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

by: middletree | last post by:
For an ASp Intranet app, I have some code that should work, but I am not able to make it happen for some reason, after spending considerable time on this. I am pretty thick when it comes to...
by: Henry Su | last post by:
Hello All, I am looking to whip a recordset out of thin air through a series of database record manipulation (so there is no physical equivalence to any database entities such as a table or...
by: Tony Williams | last post by:
I have two tables 1.tblmonth which holds two fields txtmonth and txtqtrlabel and 2. tblmain which holds a number of fields but in particular a field called txtqtrlabel2. The two tables are linked...
by: Lyn | last post by:
Hi, How do you bind the output columns from a UNION query when the fields from the two tables have different names? Consider this query (WHERE clauses omitted)... SELECT SurnameBirth,...
by: Lyn | last post by:
Hi, I am opening a form in Continuous mode to list the records from a recordset created in the calling form. The recordset object is declared as Public and is set into the new form's Recordset...
by: TD | last post by:
This is the code under a command button - Dim ctl As Control For Each ctl In Me.Controls If ctl.BackColor <> RGB(255, 255, 255) Then ctl.BackColor = RGB(255, 255, 255) End If Next ctl
by: | last post by:
I've defined an ObjectDataSource against a dataset, and I can bind the ObjectDataSource's members to data controls. I'm wondering how to take the values in an ObjectDataSource and...
by: jpr | last post by:
Hello, I am reposting a question submitted some time ago to which I did not get much help, hoping for additional advice. My database has two tables. Table1 and Table2. Table2 is a copy of...
by: adolph | last post by:
I wrote an access2000 database for a POS system. In it is a sales form with a a subform showing the items being purchased. The main form is unbound. It uses a class to hold the main form data...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.