Access GUI into Code

darkstar257

Registered User.
Local time
Today, 07:11
Joined
Jan 6, 2011
Messages
77
I'm trying to create a unit converter with the ability to create new conversions.

The Access environment of course allows us to go create code in Visual Basic and that correlates to Access's GUI environment. Is there a way for user input from Access fields to be brought into the Visual Basic editor as code?

Such as a simple conversion relation as :

F = mass*acceleration

This would be in the form of: value = variable(operator)varabie(operator)...etc.

I would need to be able to input values of an various number of variables and operators in Access and have that be created as code in its corresponding code for its own form or another form.
 
Well you could write the actual code, store it in a table, then have access create a new code module and place the code in there then use that code. However if you are doing that it would be nearly as fast or perhaps faster to just write the code into a module to begin with wouldn't it?

If you just want to put some variables and operators and have Access "figure" it out, how do you expect it to do that? Access has no knowledge of what you want to do, you could write a complex function to try and parse out some stored procedure that contains your formulas, but once again it seems like much more effort than just adding in new functions to do what you want.
 
Re: Access GUI into Code: VB Extensibility

Well you could write the actual code, store it in a table, then have access create a new code module and place the code in there then use that code. However if you are doing that it would be nearly as fast or perhaps faster to just write the code into a module to begin with wouldn't it?

If you just want to put some variables and operators and have Access "figure" it out, how do you expect it to do that? Access has no knowledge of what you want to do, you could write a complex function to try and parse out some stored procedure that contains your formulas, but once again it seems like much more effort than just adding in new functions to do what you want.

I'm creating this for someone else. They would have no knowledge of VB programming. If I was doing it for myself, I would just obviously write the code each time I wanted to add a new conversion. Hence I was trying to find a method for them to define an equation from purely using a GUI.

It seems what you're suggesting is still code to GUI

So I have started to try to create my own module through using VB. I referenced the Microsoft Visual Basic Extensibility feature in the editor and tried running this:

Code:
Dim VBAEditor As VBIDE.VBE
Dim VBProj As VBIDE.VBProject

        
        Set VBProj = ActiveWorkbook.VBProject
        Set VBComp = VBProj.VBComponents.Add(vbext_ct_StdModule)
        VBComp.Name = "NewModule"
However I'm getting an "Object Required" error. Anyone know what this means?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom