can anybody tell me why this function is not working . i have written
a this function in module and i have called in a stock1 form but it is
not working there.can you tell me why bold line is not working.
assign.zip
here is the code written in a module :
Function GetconnectionString() As String ' The result needs to be a string !!!
Dim con As ADODB.Connection
Set con = New ADODB.Connection
con.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=\asfserver\itp$\Product_tabletest.mdb")
GetconnectionString = "providwer=Microsoft.jet.OLEDB.4.0;"
End Function
here is the code written in form_load()
Private Sub Form_Load()
Combo1.AddItem "Production Consumable"
Combo1.AddItem "Maintenance Consumable"
Combo1.AddItem "Tools Consumable"
Set con = New ADODB.Connection
'con.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=\asfserver\itp$\Product_tabletest.mdb")
'Label10.Caption = Date
<strong>con.ConnectionString = GetconnectionString()</strong>
Label10.Caption = Format$(Now, "dddd, d mmmm yyyy")
Text1.CausesValidation = True
End Sub