 |
 |

07-16-2002, 08:11 AM
|
|
Newcomer
|
|
Join Date: Mar 2002
Posts: 9
|
|
Access control
|
What is the control that I should use in an Access form to show the returned record from a sql database
With the ability to edit and update …
Thanks
|
|

07-16-2002, 08:50 AM
|
 |
Centurion
|
|
Join Date: Jul 2002
Location: Montreal
Posts: 193
|
|
|
hi, you have a lot of possibility to show the record. To edit and update, i think the best it's to add dataenvironment and put your sql query in a command. After, in your form, just to add textbox, or whatever you want, and set the datasource and datafield property to the dataenvironment and command.
i hope this will help you
Scuse me for my English
|
__________________
BUD
|

07-16-2002, 09:30 AM
|
|
Newcomer
|
|
Join Date: Mar 2002
Posts: 9
|
|
|
Thanks for your response ..
I want to kill myself J …. What I have now is a Stored Procedure in SQL Server 2000., this SP will Accept one parameter (the ID Number ) and will run a ( Select * from Expense Analysis) Okay …
Now the front end is MS Access , the form that I build has a text box to enter the ID Number and here I am stuck!!!!!!!! I need a to have some kind of control or a sub form that will be populated with the returned record and after being returned being able to update this record in the SQL server ..please please help
Thank
That’s what I have so far
Create Procedure Get_Rec(@ID As Integer )
As
Select * from dbo.Expense_Analysis
where ID = @ID
**********************************************
Option Compare Database
Private Sub Command4_Click()
Dim objConn As ADODB.Connection
Dim rsData As ADODB.Recordset
Dim szConnect As String
'Create the connection String
szConnect = "Provider=SQLOLEDB;Data Source =LAPTOP\SQL2000;" & _
"Initial Catalog=GL_Details;Integrated Security=SSPI"
Set objConn = New ADODB.Connection
Set rsData = New ADODB.Recordset
objConn.Open szConnect
objConn.sp_Get_Rec Text0.Value, rsData
If Not rsData.EOF Then
????????????
End If
|
|

07-16-2002, 11:25 AM
|
 |
Centurion
|
|
Join Date: Jul 2002
Location: Montreal
Posts: 193
|
|
now, if you want to show the data, the easy way is to set the text property of your textbox with the recordset.
Eg:
Code:
text1.text = rsdata("name_field")
where name_field is a field of your procedure.
Also, if you have an textbox array, you can put it on a for.....next
Eg:
Code:
For i = 0 to nb_procedure_field
text(i).text = rsdata(i)
next
That's the easy way( but is the longuest to )
I hope this will help you
Scuse me for my English
|
__________________
BUD
|

07-16-2002, 01:51 PM
|
 |
Disillusioned Code Poet
Retired Moderator * Guru *
|
|
Join Date: Apr 2002
Location: Tennessee, USA
Posts: 12,808
|
|
See if this thread will help. Although his examples are geared toward using VB for a front-end instead of Access, the techniques should be pretty much the same.
|
__________________
Laura
Ita erat quando hic adveni.
|

07-19-2002, 08:04 PM
|
|
Newcomer
|
|
Join Date: Mar 2002
Posts: 9
|
|
|
Thinker..
First I am sorry for not getting to you earlier, I was busy restoring a database that crashed. And thank you for this wonderful and amazing file :-)
It really shows the essence of basic programming, I love it.
As far as the problem, I got to reach a solution but not really a good one .I have linked the Sql Table with Access and made a form. So the users can update the table .
I also tried to do the other solution. But could you please elaborate on it
Thank you
|
|

07-19-2002, 08:08 PM
|
|
Iron-Fisted Programmer
Retired Moderator * Guru *
|
|
Join Date: Jul 2001
Location: Fayetteville Arkansas USA
Posts: 18,127
|
|
|
Actually, that example was done by dcl3500. I just posted it.
I am not quite sure what you mean by the other solution?
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|