Anyone know how to drive Access?

If you touch your software enough does it become hardware?

Moderator: Forum Moderators

eion
Grammar Nazi
Grammar Nazi
Posts: 1511
Joined: March 18th, 2006, 22:23
Location: Beijing
Contact:

Post by eion »

bomberesque wrote:nice. Post script please, /me wants a look...

Eion, I read somewhere that VB6 will be replaced by VB.NET

The firm I work for will unlikely upgrade in the next while anyway, so I'm relatively safe, but do you know if VB.NET will be a steep learning curve from VB6 (ie, would we be better offf learning VB.NET straight off, rather than spending time on some dying language)
VB6 already has been replaced, unfortunately (by VB.NET and now VB 2005, which confusingly is the next version of VB.NET).

I haven't done much programming (except for a bit of Perl and VBA) in the last five years, but as far as I know VB.NET is fairly different - it's object-oriented, for one thing, and from the code I've seen it looks over-complicated for the simple sort of stuff that VB is really intended for.

Here's my recommendation:
- if you're just learning Visual Basic 6 to do purely Visual Basic 6 standalone applications-type stuff, then you're better off learning VB.NET.
- if you want to do Visual Basic 6 and Visual Basic for Applications stuff (i.e. code within Excel, Access, et cetera), then keep on learning Visual Basic 6, or you'll end up hideously confused.
bomberesque
Optimus Prime
Optimus Prime
Posts: 1100
Joined: November 26th, 2004, 22:23
Location: Belgium
Contact:

Post by bomberesque »

OK, ta. No plans for anything standalone. Mostly it's to customise Office apps and manage data import from some rather anachronistic planning databases that we use

I'll stick with VB6/VBA for now, I don't think these gguys will update their orifice suite anytime soon anyway.

/famous last words
eion
Grammar Nazi
Grammar Nazi
Posts: 1511
Joined: March 18th, 2006, 22:23
Location: Beijing
Contact:

Post by eion »

bomberesque wrote:OK, ta. No plans for anything standalone. Mostly it's to customise Office apps and manage data import from some rather anachronistic planning databases that we use

I'll stick with VB6/VBA for now, I don't think these gguys will update their orifice suite anytime soon anyway.

/famous last words
Even if they do update their Office suite, Office 2007 still uses Visual Basic for Applications, which is VB6-like rather than VB.NET-like. In other words, keep on doing what you were doing.
bomberesque
Optimus Prime
Optimus Prime
Posts: 1100
Joined: November 26th, 2004, 22:23
Location: Belgium
Contact:

Post by bomberesque »

eion wrote: Office 2007 still uses Visual Basic for Applications.
Ah, I was under the impression that VBA would get replaces by a sorta VBA.NET or somesuch.

/me goes back to his VB6/VBA book :eyesbleed:
Dog Pants
Site Moderator
Site Moderator
Posts: 21653
Joined: April 29th, 2005, 13:39
Location: Surrey, UK
Contact:

Post by Dog Pants »

This is an abridged version of the search input form. I've noticed that VBA in Access is slightly different from VBA in other applications and presumable VB.

Code: Select all

Option Compare Database

Private Sub Form_Load()

Dim varFilter As Integer  'Declares the variable varFilter as an integer
Dim varText As String        'Declares the variable varText as a string

End Sub

Private Sub lblClose_Click()
    On Error GoTo Err_lblClose_Click


' Close the splash screen &
' Open the main database form, frmMain

    DoCmd.Close
    DoCmd.OpenForm "frmMain"


Private Sub Option11_GotFocus()

varFilter = 1

End Sub

Private Sub Option13_GotFocus()

varFilter = 2

End Sub

Private Sub Option15_GotFocus()

varFilter = 3

End Sub

Private Sub textbox_LostFocus()

varText = textbox.Value

SendKeys (varText & "{ENTER}"), False

'If varFilter = 1 Then
DoCmd.OpenForm "frmSearchAsset"
'ElseIf varFilter = 2 Then
'DoCmd.OpenForm "frmSearchLoc"
'Else
'DoCmd.OpenForm "frmSearchInv"
'End If

End Sub
I'm still working on the IF statement. It seems to work, but the other two forms (Loc and Inv) aren't opening the prompt for the field value so the Sendkeys overwrites the first entry on the form.
eion
Grammar Nazi
Grammar Nazi
Posts: 1511
Joined: March 18th, 2006, 22:23
Location: Beijing
Contact:

Post by eion »

Dog Pants wrote:This is an abridged version of the search input form. I've noticed that VBA in Access is slightly different from VBA in other applications and presumable VB.
Definitely different from VB, relatively similar to VBA for other applications.
Dog Pants wrote:I'm still working on the IF statement. It seems to work, but the other two forms (Loc and Inv) aren't opening the prompt for the field value so the Sendkeys overwrites the first entry on the form.
That's a simple matter of changing the queries that those forms get their data from into parameter queries, as I'm sure you already know. 8)
bomberesque
Optimus Prime
Optimus Prime
Posts: 1100
Joined: November 26th, 2004, 22:23
Location: Belgium
Contact:

Post by bomberesque »

while we're at it, and coz the only programming language I ever studied was Fortran 77 back in teh errr early 90s....


Object
Class
Form

^define what programmers mean by that lot please. I am a little confused, especially as they keep being used in text as if their programming related meanings are part of teh english language and so anyone who doesn't understand them is clearly below the minimum IQ required to be part of teh species.

/scratches armpit and waits while peeling a banana
eion
Grammar Nazi
Grammar Nazi
Posts: 1511
Joined: March 18th, 2006, 22:23
Location: Beijing
Contact:

Post by eion »

bomberesque wrote: Object
Class
Form

^define what programmers mean by that lot please.
Object = just that - an object. Don't worry about it.
Class = refers to what type an object is. Think of it as being like a variable type, but the class of an object is a bit more than that - because classes have functions associated with them. I was going to type out some simple examples, but really, don't worry about it.
Form = a form in Access, I assume.
Dog Pants
Site Moderator
Site Moderator
Posts: 21653
Joined: April 29th, 2005, 13:39
Location: Surrey, UK
Contact:

Post by Dog Pants »

eion wrote: That's a simple matter of changing the queries that those forms get their data from into parameter queries, as I'm sure you already know. 8)
Indeed it was, but it took me all morning to realise. Doh!

I'm just putting the code back together now and I'll hopefully have it done by the end of lunchtime. I've decided I'm better at the aesthetic side of form design than the programming side, as they look lovely (but don't quite work yet).
Dog Pants
Site Moderator
Site Moderator
Posts: 21653
Joined: April 29th, 2005, 13:39
Location: Surrey, UK
Contact:

Post by Dog Pants »

All sorted now, and it's a thing of beauty. All beautiful blue water backgrounds and solid black navigation bars. Thanks for the help chaps :ahoy:
eion
Grammar Nazi
Grammar Nazi
Posts: 1511
Joined: March 18th, 2006, 22:23
Location: Beijing
Contact:

Post by eion »

I love it when a plan comes together. Have some :pie:!
Post Reply