473,765 Members | 1,994 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

New "Blank" Record Added When Search Runs

48 New Member
I have two forms with one calling the other to perform searches. When I run the search form the 2nd form a blank record is added to my table. The table is appended or updated from entries on the first form but the second form doesn’t reference the table at all. The queries ran from the form obviously query the table for data but these are not the same queries that update/append.

Any ideas what would cause this to happen?

As always, any help would be greatly appreciated.

Thanks,
Doug
Jun 12 '08 #1
5 1518
puppydogbuddy
1,923 Recognized Expert Top Contributor
Doug,
Check the property sheet for the second form and make sure data entry is set to No. If that doesn't fix it, then please post the code sub that you use to open the second form.

PDB
Jun 12 '08 #2
dougmeece
48 New Member
Here is the Code for the 2nd form:

Expand|Select|Wrap|Line Numbers
  1. Private Sub CboTitleSearch_AfterUpdate()
  2.     Me![TxtTitleSearch] = Me![CboTitleSearch].Column(1)
  3. End Sub
  4.  
  5. Private Sub cboPublisherSearch_AfterUpdate()
  6.     Me![TxtPublisherSearch] = Me![CboPublisherSearch].Column(1)
  7. End Sub
  8.  
  9. Private Sub CmdSearch_Click()
  10. On Error GoTo Err_CmdSearch_Click
  11.         Dim stTitle As String
  12.         stTitle = "Records_Search_Query"
  13.  
  14.         CboTitleSearch.SetFocus
  15.         Me![CboTitleSearch] = ""
  16.         subfrmTitleSearch.Visible = True
  17.         LblTitleResults.Visible = True
  18.         Forms![Records_Search]![subfrmTitleSearch].Requery
  19.  
  20. Exit_CmdSearch_Click:
  21.     Exit Sub
  22.  
  23. Err_CmdSearch_Click:
  24.     MsgBox Err.Description
  25.     Resume Exit_CmdSearch_Click
  26.  
  27. End Sub
  28.  
  29. Private Sub CmdPublisherSearch_Click()
  30. On Error GoTo Err_CmdPublisherSearch_Click
  31.  
  32.     Dim stPublisher As String
  33.     stPublisher = "Publisher_Records_Search"
  34.  
  35.     CboPublisherSearch.SetFocus
  36.     Me![CboPublisherSearch] = ""
  37.     subfrmPubSearch.Visible = True
  38.     lblPubResults.Visible = True
  39.     Forms![Records_Search]![subfrmPubSearch].Requery
  40.  
  41. Exit_CmdPublisherSearch_Click:
  42.     Exit Sub
  43.  
  44. Err_CmdPublisherSearch_Click:
  45.     MsgBox Err.Description
  46.     Resume Exit_CmdPublisherSearch_Click
  47.  
  48. End Sub
  49.  
  50. Private Sub cmdSubmitted_Click()
  51. On Error GoTo Err_cmdSubmitted_Click
  52.  
  53.      If Me![txtSubmissions] = "Yes" Then
  54.         Dim stSubmitted As String
  55.         stSubmitted = "Records_Search_Submitted"
  56.      End If
  57.  
  58.     subfrmSubmissions.Visible = True
  59.     lblSubResults.Visible = True
  60.     Forms![Records_Search]![subfrmSubmissions].Requery
  61.  
  62. Exit_cmdSubmitted_Click:
  63.     Exit Sub
  64.  
  65. Err_cmdSubmitted_Click:
  66.     MsgBox Err.Description
  67.     Resume Exit_cmdSubmitted_Click
  68. End Sub
  69.  
  70. Private Sub CmdUnsubmitted_Click()
  71. On Error GoTo Err_CmdUnsubmitted_Click
  72.  
  73.      If Me![txtSubmissions] = "No" Then
  74.         Dim stUnsubmitted As String
  75.         stUnsubmitted = "Records_Search_Unsubmitted"
  76.      End If
  77.  
  78.      subfrmUnsubmitted.Visible = True
  79.      lblSubResults.Visible = True
  80.      Forms![Records_Search]![subfrmUnsubmitted].Requery
  81.  
  82. Exit_CmdUnsubmitted_Click:
  83.     Exit Sub
  84.  
  85. Err_CmdUnsubmitted_Click:
  86.     MsgBox Err.Description
  87.     Resume Exit_CmdUnsubmitted_Click
  88.  
  89. End Sub
  90.  
  91. Private Sub CmdCancelSearch_Click()
  92. On Error GoTo Err_CmdCancelSearch_Click
  93.  
  94.     Me![CboTitleSearch] = ""
  95.     Me![CboPublisherSearch] = ""
  96.     Me![TxtTitleSearch] = ""
  97.     Me![TxtPublisherSearch] = ""
  98.  
  99. Exit_CmdCancelSearch_Click:
  100.     Exit Sub
  101.  
  102. Err_CmdCancelSearch_Click:
  103.     MsgBox Err.Description
  104.     Resume Exit_CmdCancelSearch_Click
  105.  
  106. End Sub
  107. Private Sub CmdClearForm_Click()
  108. On Error GoTo Err_CmdClearForm_Click
  109.  
  110.     Me![CboTitleSearch] = ""
  111.     Me![CboPublisherSearch] = ""
  112.     Me![TxtTitleSearch] = ""
  113.     Me![TxtPublisherSearch] = ""
  114.     Me![txtSubmissions] = ""
  115.     CboTitleSearch.SetFocus
  116.     subfrmTitleSearch.Visible = False
  117.     LblTitleResults.Visible = False
  118.     subfrmPubSearch.Visible = False
  119.     lblPubResults.Visible = False
  120.     subfrmSubmissions.Visible = False
  121.     subfrmUnsubmitted.Visible = False
  122.     lblSubResults.Visible = False
  123.     RadNo = False
  124.     RadYes = False
  125.  
  126. Exit_CmdClearForm_Click:
  127.     Exit Sub
  128.  
  129. Err_CmdClearForm_Click:
  130.     MsgBox Err.Description
  131.     Resume Exit_CmdClearForm_Click
  132.  
  133. End Sub
  134.  
  135. Private Sub RadNo_Click()
  136.     cmdSubmitted.Visible = False
  137.     CmdUnsubmitted.Visible = True
  138.     CmdUnsubmitted.SetFocus
  139.     Me![txtSubmissions] = "No"
  140.     RadYes = False
  141.  
  142. End Sub
  143.  
  144. Private Sub RadYes_Click()
  145.     CmdUnsubmitted.Visible = False
  146.     cmdSubmitted.Visible = True
  147.     cmdSubmitted.SetFocus
  148.     Me![txtSubmissions] = "Yes"
  149.     RadNo = False
  150.  
  151. End Sub
  152. Private Sub cmdExit_Click()
  153. On Error GoTo Err_cmdExit_Click
  154.  
  155.  
  156.     DoCmd.Close
  157.  
  158. Exit_cmdExit_Click:
  159.     Exit Sub
  160.  
  161. Err_cmdExit_Click:
  162.     MsgBox Err.Description
  163.     Resume Exit_cmdExit_Click
  164.  
  165. End Sub
  166.  
Here are the SQL statements for each query called in thie above code

Records_Search_ Query
Expand|Select|Wrap|Line Numbers
  1. SELECT Created_Submitted.Title, Created_Submitted.[Year Created], Created_Submitted.Submitted, Created_Submitted.[Submitted To], Created_Submitted.Website, Created_Submitted.Type, Created_Submitted.Accepted, Created_Submitted.[Date Submitted], [Date Entered]
  2. FROM Created_Submitted
  3. WHERE (((Created_Submitted.Title)=Forms!Records_Search!TxtTitleSearch));
  4.  
Publisher_Recor ds_Search
Expand|Select|Wrap|Line Numbers
  1. SELECT Created_Submitted.[Submitted To], Created_Submitted.Title, Created_Submitted.[Date Submitted], Created_Submitted.Type, Created_Submitted.Accepted
  2. FROM Created_Submitted
  3. WHERE Forms!Records_Search!TxtPublisherSearch=(Created_Submitted.[Submitted To])
  4. GROUP BY Created_Submitted.[Submitted To], Created_Submitted.Title, Created_Submitted.[Date Submitted], Created_Submitted.Type, Created_Submitted.Accepted;
  5.  
Records_Search_ Submitted
Expand|Select|Wrap|Line Numbers
  1. SELECT Created_Submitted.Title, Created_Submitted.[Year Created], Created_Submitted.Submitted, Created_Submitted.[Submitted To], Created_Submitted.Website, Created_Submitted.Type, Created_Submitted.Accepted, Created_Submitted.[Date Submitted], Created_Submitted.[Date Entered]
  2. FROM Created_Submitted
  3. WHERE (((Created_Submitted.Submitted)="yes"))
  4. GROUP BY Created_Submitted.Title, Created_Submitted.[Year Created], Created_Submitted.Submitted, Created_Submitted.[Submitted To], Created_Submitted.Website, Created_Submitted.Type, Created_Submitted.Accepted, Created_Submitted.[Date Submitted], Created_Submitted.[Date Entered];
  5.  
Records_Search_ Unsubmitted
Expand|Select|Wrap|Line Numbers
  1. SELECT Created_Submitted.Title, Created_Submitted.[Year Created], Created_Submitted.Submitted, Created_Submitted.[Submitted To], Created_Submitted.Website, Created_Submitted.Type, Created_Submitted.Accepted, Created_Submitted.[Date Submitted], Created_Submitted.[Date Entered]
  2. FROM Created_Submitted
  3. WHERE (((Created_Submitted.Submitted)="no"))
  4. GROUP BY Created_Submitted.Title, Created_Submitted.[Year Created], Created_Submitted.Submitted, Created_Submitted.[Submitted To], Created_Submitted.Website, Created_Submitted.Type, Created_Submitted.Accepted, Created_Submitted.[Date Submitted], Created_Submitted.[Date Entered];
  5.  
Anything you can tell me would be greatly appreciated. I have searched online but not really found anything good.

Thanks,
Doug

Doug,
Check the property sheet for the second form and make sure data entry is set to No. If that doesn't fix it, then please post the code sub that you use to open the second form.

PDB
Jun 12 '08 #3
puppydogbuddy
1,923 Recognized Expert Top Contributor
Doug,
I don't have the time to study all that code in detail, but it looks to me that the second form you refer is really a subform. In that case, they go together like bread and butter.....when a main form record is created, so will the subform be created. No so if you are using 2 forms. Suggest that you download sample forms (includes an example of a form w/subform, and an example of 2 forms working in synchronized fashion) from this link:

http://support.microsoft.com/kb/233324
Jun 12 '08 #4
dougmeece
48 New Member
Its actaully a form with some subforms on it. I'll check out the link.

Thanks

Doug,
I don't have the time to study all that code in detail, but it looks to me that the second form you refer is really a subform. In that case, they go together like bread and butter.....when a main form record is created, so will the subform be created. No so if you are using 2 forms. Suggest that you download sample forms (includes an example of a form w/subform, and an example of 2 forms working in synchronized fashion) from this link:

http://support.microsoft.com/kb/233324
Jun 12 '08 #5
dougmeece
48 New Member
I have this fixed. Turns out it was two things. One the form was not set with the proper data source. Second, the query was not setup properly. Once I change those two things it stopped adding the blank record.

Thanks for the help.

Its actaully a form with some subforms on it. I'll check out the link.

Thanks
Jun 13 '08 #6

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

Similar topics

4
1844
by: John Baker | last post by:
Hi: I have a query which supports a form. Te form is used to edit, update and change records in the table the query is based on. It all works fine EXCEPT that the "New" record (blank updatable record) always appears as the end of the form (i.e. the bottom), whereas it would be very helpful if it appeared at the beginning (the top of the form). Can anyone suggest a way to make this happen? Regards
4
6697
by: Tim | last post by:
I have used a graphic 'next record' button on a form. How can I stop it from going past the last existing record? In other words, I don't want it to take the user to a blank record. Thanks Tim
1
1778
by: John | last post by:
Hi I need to print "blank" invoices with invoice numbers only at the top. I have a table full of invoice numbers which I am using as the record source for the invoice report. I have placed the invoice number field on the page header and nothing in detail as there are no transactions. The problem is that even though there are several invoice number records in the source table, the report displays only one page. How can I make the report...
1
6714
by: James Pang | last post by:
myProcess.StartInfo.FileName==@"C:\WINDOWS\system32\ping.exe 10.0.0.1"; //this will not work cant find file name... myProcess.StartInfo.FileName==@"C:\WINDOWS\system32\ping.exe"; //this works myProcess.StartInfo.RedirectStandardOutput = true; myProcess.StartInfo.Verb="10.0.0.1"; // myProcess.StartInfo.Verb = "Print"; myProcess.StartInfo.CreateNoWindow = true; myProcess.StartInfo.UseShellExecute=false;
1
11220
by: jyoti202 | last post by:
Hi, Need help for this as i have been looking for it but could not get any results. We are using java as front end and DB2 as backend, i m getting the exception while executing a particular query with following error description: DB2 SQL error: SQLCODE: -901, SQLSTATE: 58004, SQLERRMC: sqlno_itr_plan::next :rc( 0) SQLCODE: -901 this error code says "Non severe System error" This query was working fine till...
4
3103
by: sid | last post by:
"about:blank" oepns new browser window I am writing a webpage that will run on other machines that I may or may not know about. My page is framed where frame1 controls the content of frame2. What I have found is that if the page in Frame2 fails to load and I get an error page. when I detect an error page I want to set frame2.location.href = "about:blank" and then write a temp error page until the server becomes available again. The...
1
1948
by: sid | last post by:
I am writing a webpage that will run on other machines that I may or may not know about. My page is framed where frame1 controls the content of frame2. What I have found is that if the page in Frame2 fails to load and I get an error page. when I detect an error page I want to set frame2.location.href = "about:blank" and then write a temp error page until the server becomes available again. The problem is that the security on some...
0
1809
by: crankeboy | last post by:
Hi Folks, My setup: Visual Studio Express 2008, VC++, .NET, BitBlt Here is a summary of the problem: - I am trying to copy a bitmap of my main form into a picture box. - To do this, I bitblt using the device contexts of the form and a bitmap object. - After blitting, the bitmap image is always blank. I don't understand what I'm doing wrong here. Here is my relevant code:
7
8696
kcdoell
by: kcdoell | last post by:
Good morning everyone: I created a form and set the default view as a continuous form. Basically the form is displaying records in which the user can add or edit new ones. The record source for this form is a query that I built that is based on a table. I have been working on this for several weeks and now I have been told that many times when a user wants to create a new record, much of the information that is displayed in a...
0
9566
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9393
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
10007
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
9946
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,...
0
9832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7371
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
6646
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
5413
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2800
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.