Re: Select records question



Chris,

I gave up on the combo box because I know the group I am doing this
for must have hundreds of patients since it is also a research facility,
so I figured they would know the patient's name and/or chart number
when the patient comes in---so they could type in either into a textbox.
I plugged in the code in the AfterUpdate area and the patient chart
number entered into the correct field on the form, but a msgbox popped
up saying "Data type mismatch in criteria expression." When I plugged it
in the OnEnter area, I did get the PCN too but without the warning..but
still no record was pulled up in either case. It is as if my records are
locked
away and I can never get access to them again to look at and/or edit. The
records ARE in the database and I can pull all of them up for use in the
Reports I have created. I just cannot seem to be able to pull them up in the
Form format. I know at one point a couple of weeks ago I was able to cycle
through the records after they were entered, but I haven't been able to do so
since then. And too much has been done between then and now for me to
retrace my steps and try to figure it out.

Susan

Chris B wrote:
>Hi Susan,
>im still rather new at this too, so if anyone disagrees with me please let us
>know so that I too can learn..
>You need to do the "compact & Repair" often when making many changes to a
>database, see if that fixes some of the the problems,
>
>Copy and paste this in the After update of the combobox729.
>.........
>Private Sub Combo729_AfterUpdate()
> ' Find the record that matches the control.
> Dim rs As Object
>
> Set rs = Me.Recordset.Clone
> rs.FindFirst "[PatientChartNumberID] = " & Str(Nz(Me![Combo729], 0))
> If Not rs.EOF Then Me.Bookmark = rs.Bookmark
>End Sub
>......................
>Is it an option to have a search text box vs a combo lookup box, ie pt chart
>number manually typed in, i was wondering how many pt's you deal with, may be
>easier to search via a text box?
>
>If it is an option then you could try this code from one of my databases,
>make a textbox and change to suit your application...
>
>Private Sub Text69_AfterUpdate()
>Dim rst As DAO.Recordset
> Set rst = Me.RecordsetClone
>
> rst.FindFirst "[Case Number] = '" & Me.Text69 & "'"
>
> If Not rst.NoMatch Then
> Me.Bookmark = rst.Bookmark
> Else
> MsgBox "Case Number not found"
>
> End If
> Set rst = Nothing
> End Sub
>
>regards
>Chris
>
>>I have tried it again using PatientChartNumber . This is the code I
>>used this time:
>[quoted text clipped - 14 lines]
>>
>>Susan


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200509/1
.



Relevant Pages

  • Re: duplicating control and incrementing another control
    ... then, if the form is filtered, it doesn't automatically carry that filtering ... forms) that specify the patient number. ... > Lesion Number w/o having to do so manually. ... > Private Sub Patient_Number_AfterUpdate ...
    (microsoft.public.access.formscoding)
  • Re: Auto Fill help
    ... Private Sub Combo34_AfterUpdate ... MsgBox "No Patient with this ID" ... The sub-form contains the appointment ... if the person is in the database it will ...
    (microsoft.public.access.forms)
  • Re: Auto Fill help
    ... Private Sub Combo36_AfterUpdate ... Dim strMsg As String, strTitle As String ... "Would you like to add a patient?" ... "Please post the code from the first instance of the line Private Sub ...
    (microsoft.public.access.forms)
  • Re: 3 small vba routines
    ... the 'Patient Number', ... Private Sub Patient_Number_AfterUpdate ... with a duplicate of the initial value OR the value in the RECIST Disease ... Lesions] form and be 1 more than the preceding value of the "Lesion Number" ...
    (microsoft.public.access.modulesdaovba)
  • RE: not in list event
    ... calling the click event code of the add new button) ... Private Sub cboFindPatient_AfterUpdate ... "patti" wrote: ... MsgBox "Use Add New Patient Button" ...
    (microsoft.public.access.formscoding)

Quantcast