Tags: access, background, backgroundcolour, color, colour, database, form, gradient, microsoft, mysql, oracle, searching, solid, sql

Background 2 Color Gradient

On Database » Microsoft Access

17,023 words with 7 Comments; publish: Fri, 06 Jun 2008 09:48:00 GMT; (25046.88, « »)

Hi,

I went searching in 'questions' to see how I can change the background

colour of my form to be more than just a solid colour. One of the threads

directed me to www.PetersSoftware.com where there is the option to download a

free MS database which explains how you can achieve a 2 colour gradient

through your form background. This is fanatasic but the problem is I am

stumped with the instructions which are very easy but because I am not a

programming, a simple instruction like "run the subroutine" does not make

sense to me. Even to "run" something to me basically means 'click on it'.

Hoping someone can help translate what steps I need to take. This is how far

I got:

"Import the Module "basBackColourGradient" from the ACCESS database

downloaded." This is fine, I got there okay. Here's where i get stumped:

" Run the sub-routine "bcg_CreateRectangles" for each form you want to add

a background colour gradient too".. THIS IS WHERE I'M STUMPED. What exact

steps do I need to take.

Then the last step is :

" Add the following sub-routine call to your forms OnOpen, OnActive event

procedure to set the back colour gradient bcg_setcolours Me '<Color1>,<Color2>

where <colour1> and <color2> are Windows system Color IDS, or MS Access

colour values. " ALSO STUMPED HERE. I know what the onopen, onactive event

procedure is but I'm not sure how exactly to set back colour gradient with

those instructions.

Really hope someone can help!

Angeline

SYDNEY

AUS

All Comments

Leave a comment...

  • 7 Comments
    • Have you looked at this solution?

      http://www.lebans.com/gradientfill.htm

      A97GradientFill.zip is a database containing a function that

      demonstrates how to enable Gradient Backgrounds for your Forms with a

      single function call.

      HTH

      Stephen Lebans

      http://www.lebans.com

      Access Code, Tips and Tricks

      Please respond only to the newsgroups so everyone can benefit.

      "Angeline" <Angeline.ms-access.todaysummary.com.discussions.microsoft.com> wrote in message

      news:F50BB275-BF38-463A-95E3-33F4CD0821EB.ms-access.todaysummary.com.microsoft.com...

      > Hi,

      > I went searching in 'questions' to see how I can change the background

      > colour of my form to be more than just a solid colour. One of the

      threads

      > directed me to www.PetersSoftware.com where there is the option to

      download a

      > free MS database which explains how you can achieve a 2 colour

      gradient

      > through your form background. This is fanatasic but the problem is I

      am

      > stumped with the instructions which are very easy but because I am not

      a

      > programming, a simple instruction like "run the subroutine" does not

      make

      > sense to me. Even to "run" something to me basically means 'click on

      it'.

      > Hoping someone can help translate what steps I need to take. This is

      how far

      > I got:

      > "Import the Module "basBackColourGradient" from the ACCESS database

      > downloaded." This is fine, I got there okay. Here's where i get

      stumped:

      > " Run the sub-routine "bcg_CreateRectangles" for each form you want

      to add

      > a background colour gradient too".. THIS IS WHERE I'M STUMPED. What

      exact

      > steps do I need to take.

      > Then the last step is :

      > " Add the following sub-routine call to your forms OnOpen, OnActive

      event

      > procedure to set the back colour gradient bcg_setcolours Me

      '<Color1>,<Color2>

      > where <colour1> and <color2> are Windows system Color IDS, or MS

      Access

      > colour values. " ALSO STUMPED HERE. I know what the onopen, onactive

      event

      > procedure is but I'm not sure how exactly to set back colour gradient

      with

      > those instructions.

      > Really hope someone can help!

      > Angeline

      > SYDNEY

      > AUS

      #1; Fri, 06 Jun 2008 09:49:00 GMT
    • Hi Angeline,

      Sure, I can walk you through this.

      1. Back-up your database.

      2. Repeat Step 1 (don't make me come over there)

      3. Create a new blank form as a "test" form called Form1.

      4. Import the module basFormBackColorGradient from

      the sample file. I think you have already done this.

      5. Compile your code. Debug | Compile from the

      menu bar in VBA Editor.

      6. Open the Debug Window. Ctrl + G

      7. Type this right into the window and hit Enter:

      bcg_CreateRectangles "Form1",True

      (replace the word true with False if you want a horizontal

      gradient.)

      8. A message box will appear warning you that changes

      will be made to the form. Say Ok.

      9. Now close the Dubg window and open the form in Design View.

      10. Add the following code to the form's Open and Activate events:

      Private Sub Form_Activate()

      bcg_SetColors Me, 16711680, 8388736

      End Sub

      Private Sub Form_Open(Cancel As Integer)

      bcg_SetColors Me, 16711680, 8388736

      End Sub

      11. Save and close the form. Then test. All should be good.

      These are just sample colors to use. There are countless

      ways to determine the specific number color you want,

      but perhaps the easiest for you to do is open the sample

      database and use the "Select Colors" form. Select a

      couple of colors you like on that form and write down

      the numbers. Then enter those numbers into the code

      above.

      Hope that helps,

      Jeff Conrad

      Access Junkie

      Bend, Oregon

      "Angeline" wrote in message:

      news:F50BB275-BF38-463A-95E3-33F4CD0821EB.ms-access.todaysummary.com.microsoft.com...

      > Hi,

      > I went searching in 'questions' to see how I can change the background

      > colour of my form to be more than just a solid colour. One of the threads

      > directed me to www.PetersSoftware.com where there is the option to download a

      > free MS database which explains how you can achieve a 2 colour gradient

      > through your form background. This is fanatasic but the problem is I am

      > stumped with the instructions which are very easy but because I am not a

      > programming, a simple instruction like "run the subroutine" does not make

      > sense to me. Even to "run" something to me basically means 'click on it'.

      > Hoping someone can help translate what steps I need to take. This is how far

      > I got:

      > "Import the Module "basBackColourGradient" from the ACCESS database

      > downloaded." This is fine, I got there okay. Here's where i get stumped:

      > " Run the sub-routine "bcg_CreateRectangles" for each form you want to add

      > a background colour gradient too".. THIS IS WHERE I'M STUMPED. What exact

      > steps do I need to take.

      > Then the last step is :

      > " Add the following sub-routine call to your forms OnOpen, OnActive event

      > procedure to set the back colour gradient bcg_setcolours Me '<Color1>,<Color2>

      > where <colour1> and <color2> are Windows system Color IDS, or MS Access

      > colour values. " ALSO STUMPED HERE. I know what the onopen, onactive event

      > procedure is but I'm not sure how exactly to set back colour gradient with

      > those instructions.

      > Really hope someone can help!

      > Angeline

      > SYDNEY

      > AUS

      #2; Fri, 06 Jun 2008 09:50:00 GMT
    • Jeff,

      YOU ARE FABULOUS!

      Thank you very much. I did it and it worked! All I need to do now is choose

      my colours and then add in then numbers! Thanks again and all the best!

      Angeline

      "Jeff Conrad" wrote:

      > Hi Angeline,

      > Sure, I can walk you through this.

      > 1. Back-up your database.

      > 2. Repeat Step 1 (don't make me come over there)

      > 3. Create a new blank form as a "test" form called Form1.

      > 4. Import the module basFormBackColorGradient from

      > the sample file. I think you have already done this.

      > 5. Compile your code. Debug | Compile from the

      > menu bar in VBA Editor.

      > 6. Open the Debug Window. Ctrl + G

      > 7. Type this right into the window and hit Enter:

      > bcg_CreateRectangles "Form1",True

      > (replace the word true with False if you want a horizontal

      > gradient.)

      > 8. A message box will appear warning you that changes

      > will be made to the form. Say Ok.

      > 9. Now close the Dubg window and open the form in Design View.

      > 10. Add the following code to the form's Open and Activate events:

      > Private Sub Form_Activate()

      > bcg_SetColors Me, 16711680, 8388736

      > End Sub

      > Private Sub Form_Open(Cancel As Integer)

      > bcg_SetColors Me, 16711680, 8388736

      > End Sub

      > 11. Save and close the form. Then test. All should be good.

      > These are just sample colors to use. There are countless

      > ways to determine the specific number color you want,

      > but perhaps the easiest for you to do is open the sample

      > database and use the "Select Colors" form. Select a

      > couple of colors you like on that form and write down

      > the numbers. Then enter those numbers into the code

      > above.

      > Hope that helps,

      > --

      > Jeff Conrad

      > Access Junkie

      > Bend, Oregon

      > "Angeline" wrote in message:

      > news:F50BB275-BF38-463A-95E3-33F4CD0821EB.ms-access.todaysummary.com.microsoft.com...

      >

      >

      #3; Fri, 06 Jun 2008 09:52:00 GMT
    • "Angeline" wrote in message:

      news:920AF868-29D5-4322-9FE4-A2DD56E455B2.ms-access.todaysummary.com.microsoft.com...

      > Jeff,

      > YOU ARE FABULOUS!

      Wow!

      <blush>

      Thanks.

      > Thank you very much. I did it and it worked! All I need to do now is choose

      > my colours and then add in then numbers! Thanks again and all the best!

      You're welcome, glad I could help.

      :-)

      Jeff Conrad

      Access Junkie

      Bend, Oregon

      #4; Fri, 06 Jun 2008 09:53:00 GMT
    • hey i am stuck in the same exact place you were but i followed the

      instructions of the solution but still no hope i am really new to this i

      don't understnad step 10. adding the code onactivate onopen how do you do

      that can you tell me how you managed to get yours working please?

      "Angeline" wrote:

      > Hi,

      > I went searching in 'questions' to see how I can change the background

      > colour of my form to be more than just a solid colour. One of the threads

      > directed me to www.PetersSoftware.com where there is the option to download a

      > free MS database which explains how you can achieve a 2 colour gradient

      > through your form background. This is fanatasic but the problem is I am

      > stumped with the instructions which are very easy but because I am not a

      > programming, a simple instruction like "run the subroutine" does not make

      > sense to me. Even to "run" something to me basically means 'click on it'.

      > Hoping someone can help translate what steps I need to take. This is how far

      > I got:

      > "Import the Module "basBackColourGradient" from the ACCESS database

      > downloaded." This is fine, I got there okay. Here's where i get stumped:

      > " Run the sub-routine "bcg_CreateRectangles" for each form you want to add

      > a background colour gradient too".. THIS IS WHERE I'M STUMPED. What exact

      > steps do I need to take.

      > Then the last step is :

      > " Add the following sub-routine call to your forms OnOpen, OnActive event

      > procedure to set the back colour gradient bcg_setcolours Me '<Color1>,<Color2>

      > where <colour1> and <color2> are Windows system Color IDS, or MS Access

      > colour values. " ALSO STUMPED HERE. I know what the onopen, onactive event

      > procedure is but I'm not sure how exactly to set back colour gradient with

      > those instructions.

      > Really hope someone can help!

      > Angeline

      > SYDNEY

      > AUS

      #5; Fri, 06 Jun 2008 09:54:00 GMT
    • I have used this coding using the following steps which may be some help to

      you.

      In the module basFormBackColorGradient there is a sub called Examples()

      I changed the coding to the following line

      bcg_CreateRectangles "frm_rpt_Courses", False

      where frm_rpt_Courses is the name of the form.

      With the cursor still in this sub I then pressed F5 various warning messages

      were displayed and the detail section of the form had vertical rectangles

      Then on Form_open event of the form I added the following code

      bcg_SetColors Me, 15322008, 16711680

      When the form is opened the background colour goes from a light blue

      (15322008) to a dark blue.(16711680)

      Allan Murphy

      Email: allanmurphy.ms-access.todaysummary.com.unwired.com.au

      "RosyCheeks " <RosyCheeks .ms-access.todaysummary.com.discussions.microsoft.com> wrote in message

      news:43492F8A-9389-4262-A824-477BFF323441.ms-access.todaysummary.com.microsoft.com...

      > hey i am stuck in the same exact place you were but i followed the

      > instructions of the solution but still no hope i am really new to this

      i[vbcol=seagreen]

      > don't understnad step 10. adding the code onactivate onopen how do you do

      > that can you tell me how you managed to get yours working please?

      > "Angeline" wrote:

      threads[vbcol=seagreen]

      download a[vbcol=seagreen]

      make[vbcol=seagreen]

      it'.[vbcol=seagreen]

      far[vbcol=seagreen]

      add[vbcol=seagreen]

      exact[vbcol=seagreen]

      event[vbcol=seagreen]

      '<Color1>,<Color2>[vbcol=seagreen]

      event[vbcol=seagreen]

      with[vbcol=seagreen]

      #6; Fri, 06 Jun 2008 09:55:00 GMT
    • Have you tried this solution?

      http://www.lebans.com/gradientfill.htm

      Updated June 8, 2004

      A97GradientFill.zip is a database containing a function that demonstrates

      how to enable Gradient Backgrounds for your Forms with a single function

      call.

      Version .8

      Fixed two bugs brought to my attention by David Fenton. The one pixel black

      border has been removed. Gradient fills now more logically starting from

      left to right and top to bottom.

      Version .7

      Fixed runtime bug. Here is the modified Form Resize event code:

      Private Sub Form_Resize()

      ' Call our function to redraw the Form's background Picture

      ' Access will generate a runtime error complaining

      ' that our image is not in the required DIB format

      ' even though it is if we:

      '1) Minimize the form

      '2) Shrink the form vertically below about 500 Twips

      If Me.WindowHeight < 500 Then Exit Sub

      GradientBackground Me, m_RGBStart, m_RGBEnd, m_Direction

      End Sub

      Version .6

      HTH

      Stephen Lebans

      http://www.lebans.com

      Access Code, Tips and Tricks

      Please respond only to the newsgroups so everyone can benefit.

      "RosyCheeks " <RosyCheeks .ms-access.todaysummary.com.discussions.microsoft.com> wrote in message

      news:43492F8A-9389-4262-A824-477BFF323441.ms-access.todaysummary.com.microsoft.com...[vbcol=seagreen]

      > hey i am stuck in the same exact place you were but i followed the

      > instructions of the solution but still no hope i am really new to this

      > i

      > don't understnad step 10. adding the code onactivate onopen how do you do

      > that can you tell me how you managed to get yours working please?

      > "Angeline" wrote:

      #7; Fri, 06 Jun 2008 09:56:00 GMT