473,513 Members | 2,524 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I prevent the first record from appearing on a form...

10 New Member
I have written a form whose function is to delete the record I have entered under the search criteria. The user enters the asset tag in the text box and presses the search cmd box . The record is then displayed in the detail section and they can press the delete cmd box to delete the record. How do I prevent the first record in my database from appearing in the detail section when the form first comes up. I've tried a few things but nothing seems to work.

Thanks,
Aug 10 '10 #1
2 4276
dsatino
393 Contributor
The reason the first record is appearing is because you have the form bound to the underlying table. If you don't want to show anything on open, the best course is probably to unbind the form from the table. Then use some code to populate field values upon user input of the asset tag.

You could also leave it bound and simply set the field visibilties to false on open and true on user input.

There's probably several other ways as well, it just depends on what you're comfortable with
Aug 10 '10 #2
Steven Kogan
107 Recognized Expert New Member
Dsatino is right.

Opening a bound form without showing any records isn't well supported. You would end up taking a different approach.

To go closer to your original method: If you remove the recordsource from the form and set each field control visible property to false you could use this sort of code for your search combo box.

Expand|Select|Wrap|Line Numbers
  1. Private Sub cboSearch_AfterUpdate()
  2.     ' Find the record that matches the control.
  3.  
  4.     If Me.RecordSource = "" Then
  5.         Me.RecordSource = "Test2"
  6.         Me.ID.Visible = True
  7.         Me.Field1.Visible = True
  8.  
  9.     End If
  10.  
  11.  
  12.     Dim rs As Object
  13.  
  14.     Set rs = Me.Recordset.Clone
  15.     rs.FindFirst "[ID] = " & Str(Nz(Me![cboSearch], 0))
  16.     If Not rs.EOF Then Me.Bookmark = rs.Bookmark
  17. End Sub
If the form has no recordsource but the fields are bound it displays "#Name".
Aug 10 '10 #3

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

Similar topics

3
2214
by: Jason A. Thompson | last post by:
Dear Access Gurus, I have a database which I hoped to use to administer questionnaires, or rather that someone who knows nothing about Access could use to administer them. Each q'aire item is on a different form and I dropped in command buttons on each to move forward and backward through the "pages" of the q'aire. Problem is, the first...
3
5008
by: Simon Rowe | last post by:
Probably really simple but I cant work it out... I have a list box on a form with a few records in. When I open the form the first record is sort of highlight with a dashed box, when I cursor down the record changes to inverse video and from then on I can sroll up and down the records with the inverse video highlight. I just cant seem to...
1
3404
by: jv | last post by:
I have quite a few of continuous form and subform where I do allow scroll bars. I run into problems with the mouse wheel whenever the data on the form does not take up the whole page. In this instance, whenever a user uses the mouse wheel to scroll down, the first record disappears off the screen and they can't get it back unless they click...
5
5224
by: tdmailbox | last post by:
I have a form with a child form. In the child form there is a list of names that can grow quite large. On the parent form I want to display the first name from the child form. I set up a test box that is populated with the code =subfrm_media_review_sec_party.Form!first_name & " " & subfrm_media_review_sec_party.Form!last_name It...
6
2846
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox and the coresponding 'Id' from the lookup table is to be inserted into the field of the new record. I have two simple tables. "tblPerson" is the...
22
2460
AccessIdiot
by: AccessIdiot | last post by:
Hello all, I have a form (frm_Entrainment) with a button that opens a 2nd form (frm_Specimen_Entrainment). The 2nd form shares an ID field with the first form (Entrainment_ID - its like opening the Orders form for a particular Customer). I have a button on the 2nd form that says "return to the first form" which really is just sitting beneath...
2
2313
by: Wayne | last post by:
Is there a workaround to the bug that loses the first record in a continuous form after using the scroll wheel if the available records don't fill the form? I know that the "up arrow" section of the scrollbar can be clicked to show the record again but this is hardly intuitive to the user. Any help is appreciated.
3
2412
by: brucedodds | last post by:
My application has a form based on a parent table with a subform based on a child table. The relationship is Cascade Delete. The first record displayed when the form opens has five child records. The form allows this record to be deleted without a prompt, though SetWarnings is set to True. When you try to delete other records, you do get a...
6
4530
by: teser3 | last post by:
I have my PHP inserting into Oracle 9i. But how do I prevent duplicate record entries? I only have 3 fields in the insert in the action page: CODE <?php $c=OCILogon("scott", "tiger", "orcl"); if ( ! $c ) { echo "Unable to connect: " . var_dump( OCIError() );
1
2997
by: SoNew | last post by:
I have a Database form in Single View for users to look-up and/or enter data. When the form loads the combo box is empty, which I like - but the fields in the form are all filled in with what the database sees as the "first" record - which is alphabetically not the first, but is as to the ID field. All that said, I would like the fields to either...
0
7397
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7565
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...
1
7128
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...
0
7543
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...
1
5103
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...
0
4759
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...
0
1612
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
1
817
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
473
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...

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.