Recent content by jp80

  1. J

    Record search code error

    When opening my form for the first time and searching for a record, it displays the 'no record found' MsgBox as well as returning the actual record. The same code works fine in another database that I have created, so what am I doing wrong here? Private Sub SearchButton_Click() Dim...
  2. J

    Search button not returning records

    Thanks for the replies. CompassRef is a text field. I have utilised ypma's code, replacing the keywords with my own, where SearchButton1 is the button, SearchField1 is the search text field, villasT is the table and villasF is the form: Private Sub SearchButton1_Click() If...
  3. J

    Search button not returning records

    I have a search button / text field on a form with the following code: Private Sub SearchButton1_Click() Dim rsTemp As Recordset If IsNull(Me.SearchField1) = False Then Set rsTemp = Me.RecordsetClone rsTemp.FindFirst "[CompassRef] = '" & Me.SearchField1 & "'" If Not...
  4. J

    Replace 2105 runtime error message with custom msgbox

    I've checked the table and there are no duplicate records. The form stops upon generation of the error message and nothing is sent to the table (as has always been the case). If non-duplicates are added to the CompassRef field, the record saves fine. As mentioned in my first post, I have...
  5. J

    Replace 2105 runtime error message with custom msgbox

    It says 'You can't go to the specified record'. On debug, it highlights 'DoCmd.GoToRecord , , acNewRec' in the SaveRecord button code.
  6. J

    Replace 2105 runtime error message with custom msgbox

    I added the code to Form_BeforeUpdate (replacing the table name as required). It now just returns the 2105 error message again. What else could I be missing?
  7. J

    Replace 2105 runtime error message with custom msgbox

    Thanks both for the super-fast replies. So that I can prevent the problem, rather than just mask the error, I have added the following code to the SaveRecord button (where villasT is the name of the table): Private Sub SaveRecord_Click() Dim rs As Recordset Set rs =...
  8. J

    Replace 2105 runtime error message with custom msgbox

    Having set a table short text field to 'Indexed (No Duplicates)', I have a form which produces a '2105 runtime error' when the user attempts to submit a duplicate value. I would like to replace this default error message with a more user-friendly MsgBox. My code for the SaveRecord button...
  9. J

    Search button with text field

    Thanks. Tried that and it worked. Happy days. :-)
  10. J

    Search button with text field

    I really appreciate your replies. The field UniqueAEVRef is indeed a textfield. I have tried both code suggestions and the search result still displays the No Record Found msgBox, even though the value entered exists in the table. Is there anything else that I could be missing? :banghead:
  11. J

    Search button with text field

    Hi, I'm fairly new to Access / VBA and have been trying relentlessly to get a text box / search button on my Access form to pull up a specific record. Although the null command produces the correct error msgBox, it does not show any record if I enter a correct primary key term. Probably...
Top Bottom