I assume you have three checkbox related to 3 fieldnames. You can create query based on the checkboxs like this
Dim mSqlText As String
mSqlText = "SELECT FieldA, FieldB, FieldC, FieldD FROM TableA WHERE "
IF Me.CheckBoxA = False Then mSqlText = mSqlText & "FieldA = "NY"...
'This is what I did to Run stored procedure "TEST"
'ALTER PROCEDURE "Test" (@YourName nvarchar(20), @YourPass nvarchar(10))
'INSERT INTO dbo.UserList (Name, Password)
'SELECT @YourName As Name, @YourPass As Password
'----------------------------------------------------------...
Just make a button and open the click event and try this code:
Private Sub buttonX_click()
Dim mSql As string
sSql = "UPDATE tablename SET columnnametoupdate = columnname1 + columnname2 WHERE columnnametoupdate <> columnname1 + columnname2"
DoCmd.RunSql mSql
End Sub
Is that what you...
Why not create function to develop SQL Text and run it as Recourd source, in the form or at other form. It's only create WHERE clause based on the existing value 0f (text/combo)box.
Example:
Dim SdlA, SqlB As String
SqlA = "SELECT Assets.BarcodeNumber, Assets.AssetDescription...
With access XP as front end and MSSQL SERVER 2000 As Back End:
It not satisfying me using "DoCmd.OpenStoredProcedure" when Executing non-select SQL, and I still questioning the effectiveness of using ADO in VBA.
Is somebody know the best way?
Thank you
Thanks Claire
I already found that I made too much parameter so while I create the procedure to joint the functions I made mistake in writing the parameter structure.
For Bertrand, here I made the sample of Joining parameter function in stored procedure as I mean
Exp. I have two functions...
I think you must create a function in module. For example:
Function CheckDate(CurrentTime)
If CurrentTime <= "07:00"
CheckDate = Date() - 1
Endif
End Function
So you can use the function in your procedures or form, like:
CurTime = Time(Date())
ShiftDate = CheckDate([CurTime])
I also use Windows XP, SQL Server 2000 (Client Tools only and MSDE) and Office XP (with Service Pack 2). Everything OK.
It might be caused by drivers program that is not compatible with your Windows XP.
Thanks to all. Now I have no more problem since I bought Office XP Developer Edition. It's including Free Access Runtime too. So my I don't have to ask my customer to upgrade their Office immediately.
I hope this information usefull for the others
About Office 2000 Service Pack, it's too large...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.