|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Datacombo box control
I am using data combo box with my database for vb with ADO. The data combo box contains the data that user can select. how do i change that selected item from the data combo box when i navigate through the record??? For example i am designing a program for patient admision. One of my data combo box is contains data of Doctors Name, bound column = dotor id. When i navgaite the recordset using ADO, how do i change that information? I am not using ADO controls on my forum, i am coding everything.
i am posting my code i hope someone can help me, u can email me if its not clear what im asking at URL Private Sub Getadmit() Dim strSQL As String strSQL = "SELECT ad.patient_idm, p.namem, " _ & "d.doctor_idm, d.doctor_namem, " _ & "di.diagnostic_codem, di.diagnostic_descriptionm, " _ & "ad.admit_datem, ad.dis_datem, " _ & "ad.accom_type_reqm " _ & "FROM ppatientm p, padmissionm ad, " _ & "pdiagnosticm di, pdoctorm d " _ & "Where d.doctor_idm = ad.doctor_idm " _ & "And di.diagnostic_codem = ad.admin_diagnosm " _ & "AND di.diagnostic_codem = ad.discharge_diagnosm " _ & "AND p.patient_idm = " & Me.txtid.Text If mrsPatient.EOF = False And mrsPatient.BOF = False Then 'synchronize the admission recordset With mrsAdmission If mrsAdmission.State = adStateOpen Then .Close End If .ActiveConnection = gcnHosp .Source = strSQL .CursorLocation = adUseClient .CursorType = adOpenStatic .LockType = adLockReadOnly .Open 'bind the admission data list box Set Me.dcbdoctor.DataSource = mrsAdmission 'i need a code so that the dcbdotor.text = to the doctor name that matches the doctor_id selected by SQL statement 'Me.dcbdoctor.Text = mrsAdmission("doctor_namem") Set Me.dcbadmincode.DataSource = mrsAdmission ' Me.dcbadmincode.Text = Val(Me.dcbadmincode.DataField = "diagnostic_descriptionm") Set Me.dcbdiscode.DataSource = mrsAdmission 'Me.dcbdiscode.BoundColumn = "diagnostic_descriptionm" Set Me.DTPadmitdate.DataSource = mrsAdmission 'Me.DTPadmitdate.DataField = "admit_datem" Set Me.DTPdisdate.DataSource = mrsAdmission 'Me.DTPdisdate.DataField = "dis_datem" Set Me.cbaccom.DataSource = mrsAdmission 'Me.cbaccom.DataField = "accom_type_reqm" End With End If End Sub Private Sub cbaccom_Change() getAvailable End Sub |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Datacombo box control |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|