Re: Select records question
- From: "Susan K via AccessMonster.com" <forum@xxxxxxxxxxxxxxxxx>
- Date: Thu, 01 Sep 2005 21:17:55 GMT
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
.
- References:
- Re: Select records question
- From: Susan K via AccessMonster.com
- Re: Select records question
- From: Susan K via AccessMonster.com
- Re: Select records question
- From: Chris B via AccessMonster.com
- Re: Select records question
- Prev by Date: RE: Temp table in DAO
- Next by Date: Re: Select records question
- Previous by thread: Re: Select records question
- Next by thread: Re: Select records question
- Index(es):
Relevant Pages
|