IR_Moon
Registered User.
- Local time
- Tomorrow, 03:30
- Joined
- Jun 6, 2006
- Messages
- 20
Hi there!
I have an Access application that displays a different colour on it's forms depending on the selected client. It's kind of somewhere between trying to make it prettiful and trying to make it functional by alerting users IMMEDIATELY to which client they are entering/viewing data for.
The database has about 12 different forms in it, and I've put this in as code on EVERY page:
Which works fine... I just duplicated this code on every form on open... The problem being I'm now looking at adding other features to this function but don't really fancy duplicating the updates 12 times for 12 forms.
I've attempted to creat a subroutine in a module that the form can refer to on open and am trying to use the above code in that module (which I'm sure is where I'm going wrong and probably shows me to be a total n00b! I've not used modules much yet!)
I get a compile error as follows:
So basically what I'm after is a method for re-using the same bit of code across multiple forms... Any help offered would be greatly received!
I have an Access application that displays a different colour on it's forms depending on the selected client. It's kind of somewhere between trying to make it prettiful and trying to make it functional by alerting users IMMEDIATELY to which client they are entering/viewing data for.
The database has about 12 different forms in it, and I've put this in as code on EVERY page:
Code:
[COLOR="Green"]' add background picture[/COLOR]
Dim BackPicName As String
BackPicName = Forms![frmOpen]![cboPickClient].Column(6) & "back_blk.bmp"
[COLOR="#008000"]'only if it exists...[/COLOR]
If Dir(BackPicName) <> vbNullString Then
Me.Picture = Forms![frmOpen]![cboPickClient].Column(6) & "back_blk.bmp"
Else 'set no background picture
Me.Picture = vbNullString
End If
Which works fine... I just duplicated this code on every form on open... The problem being I'm now looking at adding other features to this function but don't really fancy duplicating the updates 12 times for 12 forms.
I've attempted to creat a subroutine in a module that the form can refer to on open and am trying to use the above code in that module (which I'm sure is where I'm going wrong and probably shows me to be a total n00b! I've not used modules much yet!)
I get a compile error as follows:
So basically what I'm after is a method for re-using the same bit of code across multiple forms... Any help offered would be greatly received!