woyler:
Actually, I first started programming in VB when there
first was such a thing, but I'm a few years out-of-date
and still using the books for VB4.
The reason I named the database "MyFirstDB" was because
there will be more than one database used with this application.
Anyway...
In case anybody is interested, the answer is:
Include the option "dbInconsistent" in OpenRecordset,
on line# 50.
50 Set FilteredSet = MyFirstDB.OpenRecordset(SQL, dbOpenDynaset, dbInconsistent)
Weltman
Each of the fields in the tables of my database are updatable, but when I create a recordset using the following code, the fields are not updatable. I get Error #3027, Can't update...Object is read only on line #80.
Can anybody tell me why, and what I can do about it.
Public Sub DeleteCat()
On...
BeerFreak,
Thanks. The query works now, with syntax errors removed. Also, OpenRecordset likes it. Although, I don't thoroughly understand it, here is the final statement:
60 CatQuery = "SELECT * FROM Names " & " WHERE BallotNumber = '" & VarBallotNumber & "' AND...
I have a sub beginning with the following code:
Public Sub PreviousCat()
On Error GoTo EditCatError
Dim I As Integer
Dim MyDB As Database, MyRs As Recordset, FilteredSet As Recordset, CatQuery As String
10 Set MyDB = DBEngine.Workspaces(0).OpenDatabase("C:\Program Files\Microsoft Visual...
JohnYingling,
There's a possibility that I don't fully understand your
suggestion, but let me try to further clarify what I'm trying to do.
I have an array of labels. Other than the first (index 0), the labels are created at run time. Just to the right of each label is an option button. The...
I have an array of labels whose captions list candidates on a ballot. I want to make the captions of equal length regardless of some variations in the length of the candidates' names. Right now, I have the following code:
Number = 32 - (Len(CandidateName) + Len(Affiliation))...
Mark,
If You're talking about a sub in Visual Basic then the sub has to end with "End Sub". If you have the line of code "On Error Resume Next" after "End Sub" then just delete the line and recompile you program.
Weltman
Another Update.
For anybody who might be interested, this time I solved the problem by putting the instruction to set focus to the textbox back into the GotFocus Event Procedure, but this time I made it conditional as follows:
If TooMany = False Then NameBox6(Index).SetFocus
This eliminated...
Update:
Moving the line of code (See Line 50 below)from the GotFocus Event Procedure to the Click Event Procedure solved the problem.
Private Sub Check5_Click(Index As Integer)
On Error GoTo ErrorHandler
'Countem to make sure there's no overvote.
10 CountChecks(5) = 0
20 MaxVotes = 2
30 Call...
AudioPlayer65,
My understanding is that the MsgBox is automatically modal, since the button value for modal is 0.
Incidentally, I am still having problems with this whole thing, but it's a long story, and I'll post it as soon as I have time to summarize it. Thanks for your response.
Weltman
I found the problem, thanks to you guys!
It was in the GotFocus Event Procedure, and as Chip suspected, was caused by "SetFocus."
At the bottom of the procedure (NameBox5(3).SetFocus:
Private Sub Check5_GotFocus(Index As Integer)
Frame1(5).BackColor = &HE0E0E0 'Highlight Frame
For...
Jeff,
I tried running the program with your numbered lines of code and the error handler. I do not get the message from the error handler at all. I only get the run time error message, and when I click OK I get the message that I was trying to display in the event of an overvote.
But, here's...
Thanks for your advice so far. I'm not even sure I'm doing this posting correctly, but here's the code:
Private Sub CountemUp5(Index As Integer, MaxVotes As Integer)
For IndexNumber = 0 To 3
If Check5(IndexNumber).Value Then
CountChecks(5) = CountChecks(5) + 1
End If
If CountChecks(5)...
I get a run time error 5 (Invalid Procedure or Argument) in the compiled version of my program only, when trying to use the MsgBox Function to display a message in a Click Event Procedure.
Here's the Procedure:
Private Sub Check5_Click(Index As Integer)
On Error Resume Next
'Countem to make...
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.