473,785 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Referencing Microsoft Access Forms in a .dll

Can

I have a Microsoft Access front end, SQL server backend and I am using .dll
files to complete the n-tier application. How do I reference an unbound
textbox (from Microsoft Access) in the .dll?

In the code below it does not recognize
Forms!SQL_Serve r_Prompt
Patient_Hospita l_ID -> unbound textbox in a MS Access form
Select_Waiting_ List -> unbound textbox in a MS Access form
Select_OR_Compl eted -> unbound textbox in a MS Access form
Select_Billing_ Completed -> unbound textbox in a MS Access form

For example:

Imports System.net
Imports System.IO
Imports ADODB
Imports System.Data
Imports System.Data.Ole Db
Imports CardiacSurgeryD ata.DataAccess

Public Class CardiacSurgeryP atients

Private Const conModuleName As String = "CardiacSurgery Patients"

Public Function GetRstPatient_I D( _
ByVal ConnectionStrin g As String, _
ByVal Patient_Hospita l_ID As String, _
ByVal Select_Waiting_ List As String, _
ByVal Select_OR_Compl eted As String, _
ByVal Select_Billing_ Completed As String) As ADODB.Recordset
On Error GoTo Handle_Err

Const conProcName = conModuleName & ".GetRstPatient _ID"
Dim rst As ADODB.Recordset
Dim da As CardiacSurgeryD ata.DataAccess

' Use another middle-tier object to run a stored procedure and
return a disconnected, read-only recordset.
da = New CardiacSurgeryD ata.DataAccess
rst = da.GetRstFromSP wQuadrupleInput Param( _
ConnectionStrin g:=Forms!SQL_Se rver_Prompt.OLE DBConnect, _
StoredProcName: ="pPatientList_ ID", _
RstLockType:=AD ODB.LockTypeEnu m.adLockReadOnl y, _
ParamDataType1: =ADODB.DataType Enum.adWChar, _
ParamSize1:=9, _
ParamValue1:=Me .Patient_Hospit al_ID, _
ParamDataType2: =ADODB.DataType Enum.adWChar, _
ParamSize2:=12, _
ParamValue2:=Me .Select_Waiting _List, _
ParamDataType3: =ADODB.DataType Enum.adWChar, _
ParamSize3:=13, _
ParamValue3:=Me .Select_OR_Comp leted, _
ParamDataType4: =ADODB.DataType Enum.adWChar, _
ParamSize4:=16, _
ParamValue4:=Me .Select_Billing _Completed)
GetRstPatient_I D = rst
rst = Nothing
da = Nothing

Exit_Here:
Exit Function
Handle_Err:
Select Case Err.Number
Case Else
Err.Raise(Err.N umber, conProcName, Err.Description ,
Err.HelpFile, Err.HelpContext )
End Select
Resume Exit_Here
Resume
End Function

End Class

This may sound complicated but the theory was we had a bunch of MS Access
databases and want to convert them to SQL. We still want to use the MS
Access frontends but we want to create as much flexibility for the future, a
lot of this databases will probably become web-based.

Thanks,

Candace
Nov 21 '05 #1
2 2288
It looks to me like you just need to pass the text value of those text
boxes, not a reference to the actual textbox.

Tom

Can wrote:
I have a Microsoft Access front end, SQL server backend and I am using .dll
files to complete the n-tier application. How do I reference an unbound
textbox (from Microsoft Access) in the .dll?

In the code below it does not recognize
Forms!SQL_Serv er_Prompt
Patient_Hospit al_ID -> unbound textbox in a MS Access form
Select_Waiting _List -> unbound textbox in a MS Access form
Select_OR_Comp leted -> unbound textbox in a MS Access form
Select_Billing _Completed -> unbound textbox in a MS Access form

For example:

Imports System.net
Imports System.IO
Imports ADODB
Imports System.Data
Imports System.Data.Ole Db
Imports CardiacSurgeryD ata.DataAccess

Public Class CardiacSurgeryP atients

Private Const conModuleName As String = "CardiacSurgery Patients"

Public Function GetRstPatient_I D( _
ByVal ConnectionStrin g As String, _
ByVal Patient_Hospita l_ID As String, _
ByVal Select_Waiting_ List As String, _
ByVal Select_OR_Compl eted As String, _
ByVal Select_Billing_ Completed As String) As ADODB.Recordset
On Error GoTo Handle_Err

Const conProcName = conModuleName & ".GetRstPatient _ID"
Dim rst As ADODB.Recordset
Dim da As CardiacSurgeryD ata.DataAccess

' Use another middle-tier object to run a stored procedure and
return a disconnected, read-only recordset.
da = New CardiacSurgeryD ata.DataAccess
rst = da.GetRstFromSP wQuadrupleInput Param( _
ConnectionStrin g:=Forms!SQL_Se rver_Prompt.OLE DBConnect, _
StoredProcName: ="pPatientList_ ID", _
RstLockType:=AD ODB.LockTypeEnu m.adLockReadOnl y, _
ParamDataType1: =ADODB.DataType Enum.adWChar, _
ParamSize1:=9, _
ParamValue1:=Me .Patient_Hospit al_ID, _
ParamDataType2: =ADODB.DataType Enum.adWChar, _
ParamSize2:=12, _
ParamValue2:=Me .Select_Waiting _List, _
ParamDataType3: =ADODB.DataType Enum.adWChar, _
ParamSize3:=13, _
ParamValue3:=Me .Select_OR_Comp leted, _
ParamDataType4: =ADODB.DataType Enum.adWChar, _
ParamSize4:=16, _
ParamValue4:=Me .Select_Billing _Completed)
GetRstPatient_I D = rst
rst = Nothing
da = Nothing

Exit_Here:
Exit Function
Handle_Err:
Select Case Err.Number
Case Else
Err.Raise(Err.N umber, conProcName, Err.Description ,
Err.HelpFile , Err.HelpContext )
End Select
Resume Exit_Here
Resume
End Function

End Class

This may sound complicated but the theory was we had a bunch of MS Access
databases and want to convert them to SQL. We still want to use the MS
Access frontends but we want to create as much flexibility for the future, a
lot of this databases will probably become web-based.

Thanks,

Candace

Nov 21 '05 #2
Can

Thanks. How do I pass the text value of those text boxes?
"tomb" wrote:
It looks to me like you just need to pass the text value of those text
boxes, not a reference to the actual textbox.

Tom

Can wrote:
I have a Microsoft Access front end, SQL server backend and I am using .dll
files to complete the n-tier application. How do I reference an unbound
textbox (from Microsoft Access) in the .dll?

In the code below it does not recognize
Forms!SQL_Serv er_Prompt
Patient_Hospit al_ID -> unbound textbox in a MS Access form
Select_Waiting _List -> unbound textbox in a MS Access form
Select_OR_Comp leted -> unbound textbox in a MS Access form
Select_Billing _Completed -> unbound textbox in a MS Access form

For example:

Imports System.net
Imports System.IO
Imports ADODB
Imports System.Data
Imports System.Data.Ole Db
Imports CardiacSurgeryD ata.DataAccess

Public Class CardiacSurgeryP atients

Private Const conModuleName As String = "CardiacSurgery Patients"

Public Function GetRstPatient_I D( _
ByVal ConnectionStrin g As String, _
ByVal Patient_Hospita l_ID As String, _
ByVal Select_Waiting_ List As String, _
ByVal Select_OR_Compl eted As String, _
ByVal Select_Billing_ Completed As String) As ADODB.Recordset
On Error GoTo Handle_Err

Const conProcName = conModuleName & ".GetRstPatient _ID"
Dim rst As ADODB.Recordset
Dim da As CardiacSurgeryD ata.DataAccess

' Use another middle-tier object to run a stored procedure and
return a disconnected, read-only recordset.
da = New CardiacSurgeryD ata.DataAccess
rst = da.GetRstFromSP wQuadrupleInput Param( _
ConnectionStrin g:=Forms!SQL_Se rver_Prompt.OLE DBConnect, _
StoredProcName: ="pPatientList_ ID", _
RstLockType:=AD ODB.LockTypeEnu m.adLockReadOnl y, _
ParamDataType1: =ADODB.DataType Enum.adWChar, _
ParamSize1:=9, _
ParamValue1:=Me .Patient_Hospit al_ID, _
ParamDataType2: =ADODB.DataType Enum.adWChar, _
ParamSize2:=12, _
ParamValue2:=Me .Select_Waiting _List, _
ParamDataType3: =ADODB.DataType Enum.adWChar, _
ParamSize3:=13, _
ParamValue3:=Me .Select_OR_Comp leted, _
ParamDataType4: =ADODB.DataType Enum.adWChar, _
ParamSize4:=16, _
ParamValue4:=Me .Select_Billing _Completed)
GetRstPatient_I D = rst
rst = Nothing
da = Nothing

Exit_Here:
Exit Function
Handle_Err:
Select Case Err.Number
Case Else
Err.Raise(Err.N umber, conProcName, Err.Description ,
Err.HelpFile , Err.HelpContext )
End Select
Resume Exit_Here
Resume
End Function

End Class

This may sound complicated but the theory was we had a bunch of MS Access
databases and want to convert them to SQL. We still want to use the MS
Access frontends but we want to create as much flexibility for the future, a
lot of this databases will probably become web-based.

Thanks,

Candace

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2593
by: Tony Williams | last post by:
I have a form on which there is a tabcontrol and on this onr of the tabpages is a tick box which opens Outlook with data from the main form and prompts the user to amend the message before being sent. The code is Private Sub Loadtxt_Click() Dim oA As Outlook.Application Dim oM As Outlook.MailItem Set oA = CreateObject("Outlook.Application") Set oM = oA.CreateItem(olMailItem)
2
4769
by: William Wisnieski | last post by:
Hello Everyone, Access 2000 I have a main form with a continuous subform. On the main form I have a text box that references a field on the subform. What I'd like it to do is show the value in the field of the last record entered on the subform. But what its doing is referencing whatever record the user clicked on last before closing all the forms. Also if the user cleared the subform field, I would like the text box on the main...
2
2289
by: Sean Mullaly | last post by:
I have a custom Access menu with sub-menus and sub-sub-menus. (220 items). Right now I have created 220 Functions and attached each individual Function to the specific OnAction property. The Functions return Text which is the same as the Caption of the sub-sub-menu items. I would like to reference the Custom Popup Caption of these sub-sub-menus and pass it through one Function for input in a form. *** Sent via Developersdex...
4
1850
by: mplogue | last post by:
I have a form (frmMain) with a subform (frmSub), each with enumerated fields of the same name (txt1, txt2, etc). I'm trying to make a function that will take the values for each field in frmMain, and put them in the same-named field in the subform. Here's the function: '--------Start Code-------- Function cmdFillSub() Dim i As Integer
12
1961
by: Mark Broadbent | last post by:
Hi guys, just going through remoting at the moment and a couple of questions relating to .net in general has surfaced. Firstly I have seen in the designer that for the namespace and many of its associated classes of System.Runtime.Remoting are available, but certain ones are not. A reference to System.Runtime.Remoting needs to be added to make available all the unavailable ones. Now although I (think) understand the concept that an...
7
6202
by: Dave | last post by:
I have two forms, Form1 and Form2. From Form2, how do I reference the value in a control on Form1? Or perhaps a more specific question: Form1 contains a textbox with the value of 10. This form is hidden. Form2 is active and a user enters a value of 2 into a blank text box. How can I add this value to the textbox in Form1 so that when Form1 is displayed it's textbox displays 12? I probably have the wrong mindset here; I'm thinking...
3
1815
by: Jozef | last post by:
Hi Folks! I'm trying to reference a specific table using the containers collection. I'm trying to use my help file to find out more about how to accomplish this, but for some reason, when I double click on the topic, the page won't open. Right now I'm trying to loop through each document until the document name equals what I'm looking for. What is the syntax for referencing a specific document without having to loop through all the...
9
7362
by: Alan | last post by:
Hmmm, I'm not too good with the syntax of referencing a subreport. I have frmInvoice which has the invoice details (e.g. ProductCode, ProductCost etc) in the subform frmInvoiceDetails. I'm trying to get a field (AccountID) to show in the parent form based on whether a particular product code (EXT) is present in the list of ProductCodes on the subform. So far I've tried: IIf(Reports!!="EXT",Null,!)
2
2447
by: Matt | last post by:
Ok here is my problem: I have a MDI parent form called "Main" that I declare in a public module when I start up my program. This form holds the drop down menu that allows my users to access all of the child forms. Now lets say I have a child form called "Child." When I open up that child form from "Main" I shut off the menu on "Main" so that the user cannot open up any other forms while they are in the "Child" form.
0
9646
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9484
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10157
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9957
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6742
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5386
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.