Case select & opening macro

  • Thread starter Thread starter Naz
  • Start date Start date
N

Naz

Hi

I have 2 questions i need help with

1) How can i get code to run as soon as the database opens, is there an open
datase base event? I know how to get a macro to run i.e. by making it
autoexec but not code in a module

2) How do i do a case select with multiple criteria ....i.e something like


Private Sub Checkname()

SelName = username()

Select Case SelName

Case "ij34", "mh45","jm56"
do code

Case "fb56", "fg1", "rt21"
do code 2

Case Else
do code 3

End Select

End Sub

All help is appreciated.
 
Naz said:
Hi

I have 2 questions i need help with

1) How can i get code to run as soon as the database opens, is there an
open
datase base event? I know how to get a macro to run i.e. by making it
autoexec but not code in a module

2) How do i do a case select with multiple criteria ....i.e something like


Private Sub Checkname()

SelName = username()

Select Case SelName

Case "ij34", "mh45","jm56"
do code

Case "fb56", "fg1", "rt21"
do code 2

Case Else
do code 3

End Select

End Sub

All help is appreciated.

--

_______________________
Naz,
London

1) Make a function in a standard module called say Startup. Then make an
AutoExec macro with one action: RunCode, specifying your function name like:

Startup()

2) The code you posted looks ok. What's the problem exactly?
 
Back
Top