Increment Text box value from combo box selection

foxtet

Registered User.
Local time
Today, 23:39
Joined
May 21, 2011
Messages
129
Hi every one

I have table A patients and table B doctors. when patient come for consultation, i want issue token number for each patient from a doctor they wish... i tried hours and hours on this task but still i found NO solution..can any expert in this forum kindly help me how to get a SOLUTION for this....

any help is appreciated???
fox
 
I assume the following:

  1. Patients' Token Serial Number starts from 1 onwards each day for each Doctor.
  2. Patients' Table have Doctor's Code, Current Date, Token Serial Number and other fields.
  3. Current Date must be present on the Form before you select the Doctor's name from the Combobox list.
  4. A new record is added to the Patients' Table for each Token issued with patient's details.
  5. The following Code Runs on the Doctor selection Combobox Click event procedure:

Code:
Private Sub cboDoctor_Click()
Dim m_CurrentDate as Date, m_DoctorCode, s

If Me.NewRecord Then
    m_CurrentDate = Me!CurDate
    m_DoctorCode = Me![cboDoctor]
    s = Nz(DMax("Token", "Patients", "DoctorCode = '" & m_DoctorCode & "' AND CurDate = " & m_CurrentDate), 0)

    s = s + 1
    Me![Token] = s
End If

End Sub

Modify the code wherever field/control names are different.
 
Last edited:
Thank you for the reply;

I am here attaching you a new copy of the database file for you to work on the logic that I have found very difficult to solve.

When patients come for consultation each patient will be given a token number from a doctor they wish.

Now when you double click a patient name from the search list box in the frmMain, frmPatient window opens in that window there is a button called “Generate Memo in this memo window there is doctor’s combo box to select doctor.

Now when you select doctor the token number for that doctor should display the text box given there. Token number text box should be editable so that user can put any number for a given doctor after that it should count next number. I have tried to build logic for this still I am unable to do this.

Can you pls bring necessary changers to table structure and build this logic
Your help is highly appreciated
 
Last edited:

Users who are viewing this thread

Back
Top Bottom