Ask Experts Questions for FREE Help !
Ask
    Sheba2014's Avatar
    Sheba2014 Posts: 3, Reputation: 1
    New Member
     
    #1

    Aug 5, 2014, 12:33 PM
    Forms - button code
    Hi Scott, I have the below code in the OnChange event of my search box. It uses a subform to search the database. It searches as I type and double clicking on the record will populate the main form therefore making the SEARCH button beside it redundant. I don't want to get rid of the button for aesthetic reasons and also because right now, my database is small so before I complete typing in the text the record comes up but in the live environment, the database will consist of huge historical data. I want to reuse the code and ADD the functionality of the button to the form. How can I modify the ELSE part for the button please? Currently, it has no code

    main form - ObstetricsForm
    sub form - ObstetricSubform
    search box - cmdSRCHBOX
    search button - cmdSRCHBTN
    fields: [TripID], [PatientID]

    If Len(cmdSRCHBOX.Text & vbNullString) = 0 Then
    ObstetricSubform.Form.Filter = vbNullString
    ObstetricSubform.Form.FilterOn = False
    Else
    ObstetricSubform.Form.Filter = "[TripID] Like '*" & cmdSRCHBOX.Text & "*' OR [PatientID] Like '*" & cmdSRCHBOX.Text & "*'"
    ObstetricSubform.Form.FilterOn = True
    End If
    End With

Check out some similar questions!

Non working radio button for code input [ 2 Answers ]

I have a 2003 honda civic... my battery went dead from kids leaving the inside lights on all night.. im the original owner and I do have the code but the # 1 button doesn't work to put the code back in... does anyone know how to fix this problem... I miss my music.

Official Forms Maricopa County Recorder forms? [ 1 Answers ]

Where can I obtain a new form for recording purposes for Maricopa County?

Convert word fillable forms to adobe forms [ 1 Answers ]

I am converting word fillable form into adobe fillable form, but not all of the tags are converting over. Help please. Thanks

Press sleep button and switch on/off button to be able to see login screen [ 1 Answers ]

Friend of mine has got problem with his new desktop (XP SP2) , when he starts the PC it boots normally till it reaches where it shows windows XP logo then the screen gets blank (i.e he can not see the login name for users). What he used to do: is press the sleep button on the keyboard, then...


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.