I have downloaded the WSS 3.0 extensions for VS2005, but this only creates C# templates. Does anybody know where I can lay my hands on a set of VB templates for creating sharepoint webparts?
OK, here goes. The code hooks the window messages for each textbox individually. Within the Form_Load event we hook the messages and remember to unhook them in the Form_Unload event - otherwise you will crash the IDE very quickly! The form has a public sub (HandleMouseHook) to handle the mouse...
You could hook the main window procedure using the SetWindowLong API call and trap the WM_WINDOWPOSCHANGED message. It's very involved though and requires expert coding skills so I'm not going to attempt to post any code here at the moment.
I have got some code that hooks the window message...
MonthNumber = Month("1 " & [MonthPymtFor] & " 2000")
- builds a string e.g. "1 FEB 2000", then returns the month number (quick & dirty solution).
In addition to the other suggestions, publish your database as a mde (or ade) by clicking Tools -> Database Utilities -> Make MDE File. This is a cut down version of the database that has all of the editing functions stripped out - your users cannot alter the design of forms, queries, tables...
Ah! Now we are in ADO we don't need to do the MoveLast/MoveFirst - it will give an accurate RecordCount (under most circumstances) without it.
Looks like by default you will get a forward-only recordset. Before you Open the recordset, set it's CursorType property to either adOpenKeyset or...
Pull it into a temporary table, duplicates and all. Then perform a SELECT DISTINCT query on the temporary table.
Unfortunately unless you write the import routine yourself you will not be able to exclude duplicates during the import phase. If you do write your own import routine, check whether...
You need some parameters.The way lynchg described it uses fields on your form to contain the upper & lower values for the date. You could as an alternative use 'imaginary' fields which means Access will prompt you when the query runs. lynchg's form method is more robust as you can verify that...
Create a brand new database and import all of your data into it. There are no guarantees it will work, but this is the only solution I have found when a compact/repair won't fix it.
What references have you got? CurrentDB() returns a DAO.Recordset. By default in Access 2000 you will be using a ADODB.Recordset. If so, use CodeProject.Connection.
Dim rs1 As ADODB.Recordset
Set rs1 = New ADODB.Recordset
Set rs1.ActiveConnection = CodeProject.Connection
rs1.Open StrSql
etc...
If you are using DAO (which you are if you are referencing CurrentDB), you will need to fully populate the recordset.
If Not rs1.EOF Then
rs1.MoveLast
rs1.MoveFirst
End If
total = rs1.RecordCount
BTW:
Dim A, B, C As String
A and B will be Variants - only C will be a string.
You want -...
Try using some aliasing - it will make your SQL code much easier to read. e.g.
SELECT a.AdvertID, m.[Name]
FROM tblAdverts a
INNER JOIN tblMembers m
ON m.MemberID = a.MemberID
With all those joins it may also be worth considering saving some of the subqueries as individual queries. You can...
If I understand you, you want the serial numbers that occur at the top & bottom of a range based on your given serial number. In other words, the serial number 300 before your one and the one 300 after - not SN-300 & SN+300 necessarily.
OK, but in Access it's going to take 3 queries as Access...
I assume you want to launch a window ;) VB does not (easily) support multi-threading, so if your other window is doing any work you will need to liberally spread DoEvents statements throughout the code.
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.