RGB Function Access 2013

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Not enough info to help you - no idea what you have that doesn't work, or why. Post your attempt and/or provide more info.
 
Upvote 0
Fair enough. I am unable to run this example because it returns a Type Mismatch error.[FONT=Tahoma, Calibri, Verdana, Geneva, sans-serif]
[/FONT]MyTextBox.BackColor =RGB(255,0,0)


The RGB function returns a Long representing an RGB color value, but the VBA editor in my Access 2013 does not recognize RGB() as a valid function.


I know I have other options to set color other than using RGB, but the question here is why the RGB function is not an available option. I don't see what reference am I am missing. According to the documentation this RGB function is part of the Visual Basic for Applicators dll which I do have set.


</pre>
 
Upvote 0
why the RGB function is not an available option.
Are you saying this because it doesn't work for you? If you use the correct syntax, Intellisense (in the VB editor) should prompt with the paramaters a method, function or other similar reference, is looking for, as long as you have the required references set in your project. You are missing the form reference in your example:
Me!MyTextBox.BackColor =RGB(255,0,0)
I'm using 2007, but according to Office Dev Center, this is still available in version 2013 for Access.
 
Upvote 0
The issue is only on the machine I am working on. The access database on another computer, with the exact same version of access (office 360), works as expected, no issues with the RGB function.

I can't figure out how to fix on the computer in question (short of re-installing). Thank you for responding.
 
Upvote 0
Solved... Sort of.

Seems l have a conflict on this machine. In order to get the RGB function to work I need to use is it as such... VBA.Information.RGB(255,255,255)

Event thought the references are exactly like the other boxes I've tested with.
 
Upvote 0
Since we haven't discussed project references, perhaps there is an issue with a missing reference on the pc it doesn't work on, or it's the wrong version, or it's not registered. I found this
Code:
Sub ListReferences()
Dim refCurr As Reference

  For Each refCurr In Application.References
    Debug.Print refCurr.Name & ": " & refCurr.FullPath
  Next

End Sub
You could compare the results on the two machines. The following link has a routine for getting the version as well.
API: Get Version of Office Exes (detecting Office patches)
 
Upvote 0

Forum statistics

Threads
1,221,831
Messages
6,162,248
Members
451,756
Latest member
tommyw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top