|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi all,
Actually i want to copy the value returned by a SQL query into a text box. I'm using the following code. Dim sqlTxt As String Dim sSocial As String Dim db As DAO.Database Dim rs As DAO.Recordset Set db = CurrentDb() sSocial = SSN.Value sqlTxt = "Select Student.[GRADUATION DATE] from Student where Student.SSN = '" & Me.SSN & "';" Set rs = CurrentDb.OpenRecordset(sqlTxt) Me.expectedGradDate = rs("GRADUATION DATE") I am getting data type mismatch in criteria expression Run Time error 3464. I have included DAO 3.6 library. Please help me out. Thanks in advance. --Roche |
|
#2
|
||||
|
||||
|
Just for getting one value in textbox you can use the following line
me!expectedGradDate = dlookup("Graduation Date","Student","SSN = '"& Me.SSN & "') If SSN data type is number use the following line me!expectedGradDate = dlookup("Graduation Date","Student","SSN = "& Me.SSN) |
|
#3
|
|||
|
|||
|
Thanks
Hi supersubra,
Nice to hear that u r from coimbatore. I am from Warangal, AP. Thanks a lot man. Before trying as wot u have told me, my BOSS has checked the application and asked abt Referential Integrity(RI). But i have got a new problem. basically i have not given a thought for Referential Integrity while designing tables. Now my BOSS has asked me to enforce it. As i have heard that MS ACCESS doesn't enforce RI, i have to enforce it in the code. Am i correct??. Any suggestions!!! Regards. Rochesternew |
|
#4
|
|||
|
|||
|
MS Access does a very good jpb of enforcing Referential Integrity and would recommend using Access Referential Integrity as it will always be in place and you won't have to remember to code for it. And like most DBs it also lets you control cascade updates and deletes.
This is all built into the relationships you will establish between tables. S- |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > URGENT: Problem in using DAO Recordset |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|