Web Database DropDown Combo Box (1 Viewer)

finneyz

Registered User.
Local time
Today, 10:03
Joined
Dec 27, 2012
Messages
51
I've been using the subroutine for my database and now need to move it to a web database. I use the combo box for one selection, to fill in my other fields

Ive been using the
Me.TXTHULL_NO.Value = Me.CBO_CONT.Column(1)
line to input for my other fields.

How can I use something similar for a web database. (including macros)

I see that this line in my web database does not work for VB.
Anyone that may be able to help me in this matter? thanks.
 

finneyz

Registered User.
Local time
Today, 10:03
Joined
Dec 27, 2012
Messages
51
PS this was my original row source data from the client database
SELECT [contract_qry].[CONTRACT_NO], [contract_qry].[HULL_NO], [contract_qry].[PROGRAM_MANAGERS], [contract_qry].[SET_QTY], [contract_qry].[DISTRIBUITION] FROM contract_qry ORDER BY [CONTRACT_NO];
 

Beetle

Duly Registered Boozer
Local time
Today, 08:03
Joined
Apr 30, 2011
Messages
1,808
You can't use code in a web form, as you seem to have discovered. To do what you're describing in a web form you'll need two macros;

1) A table level Data Macro to look up the appropriate field value associated with the bound column of the combo box on your form. You will need to create a parameter for this Data Macro. Keep in mind that you don't actually supply the value from within the Data Macro, you just create the parameter. The value is supplied by the second macro.

2) The second macro would be an embedded macro in the the web form. This macro would run the Data Macro (using the RunDataMacro action) and supply the parameter value. You would likely need to repeat this macro in both the Current event of the form and the After Update event of the combo box.
 

finneyz

Registered User.
Local time
Today, 10:03
Joined
Dec 27, 2012
Messages
51
Beetle I've written to you personally thank you.
 

Beetle

Duly Registered Boozer
Local time
Today, 08:03
Joined
Apr 30, 2011
Messages
1,808
I got your message but I will answer in the thread so that others with similar issues may benefit.

First, before we get to the details of your problem I want to make sure that you understand what you're getting into with attempting to create an Access "web" application. Some have made the mistake of thinking that with the newer versions of Access (2010 and 2013) you can just create a few web forms and then you will be able to access your application remotely via the web. This is not the case at all. An Access "web" application uses Microsoft Sharepoint as the data store. And not just any version of Sharepoint. It must be a version that includes Access Services. If your organization is not already running Sharepoint and is not planning on purchasing it (we're talking an investment of thousands of dollars here), then there are third party companies that offer Access hosting services on Sharepoint. A third party service would typically charge you on a per user monthly basis. This is not the only way to access your application remotely, there are other methods discussed here, but this is what it takes to actually run an Access "web" application, where your web forms are run remotely in a browser, so that is why I bring it up.

If you are going to invest a considerable amount of time and effort to learn how web queries and forms work, understand the new macro system, how to properly manage your data via macros, the difference between Data macros vs. Embedded macros, etc., etc., then you want to make sure that in a few weeks or months you're not going to discover that it was all in vain because your organization has no intention of spending the money necessary to actually run an Access "web" application. With the other methods (3 and 4) discussed in the link above you would be using standard Access client objects (queries, forms, etc.) so there would be no need to learn new methods and recreate all your user interface objects. It may require you to design some of your objects (like queries and form record sources) more efficiently so that they run well in a remote environment, but it's not a whole new paradigm.

Having said all that, if you want to proceed with the web forms, then post back with more details about what exactly you need to accomplish (It's not really clear if you're trying to create cascading combo boxes, extract data from the non-bound column of a single combo box, or something else) and I will try to help you.
 

finneyz

Registered User.
Local time
Today, 10:03
Joined
Dec 27, 2012
Messages
51
Thank you much for your response Beetle. I do wish it was an easy solution but currently it is not. We do need a web based database specifically written in access. That was the request. The main form must be able to be accessed with a web browser. So someone in England may be able to access the web designed database. the access web database

I read over the link provided. Of course the first two options wouldn't be able to be considered. Not all the users will be able to have access installed. Or clients rather.

The second link provided, I've read over as well. Having someone on site setup citrix /terminal services is not an option. In my opinion, I do not believe it to be wise that everyone gets a copy of the FE database Again not everyone will have the ability to have MS ACCESS.

As far as the web forms are entailed. This is what I am trying to achieve.
A non bound 5 column width combo box cascading (when selected) on after update to propagate into the other txt boxes.

I am pulling data from 1 Query. So data will only come from 1 tbl basically

I was using the me.txtbox.value=me.cbo.column(2) in my client. Until it was decided to move to a web version.


See images below
or attachments


I hope that helps Been trying to follow some other examples online

I appreciate your responses. Just upset that now my work, has to be migrated over to this macros stuff.

Thanks have a good rest of the day
 

Attachments

  • populate.jpg
    populate.jpg
    91.9 KB · Views: 391
  • 33.jpg
    33.jpg
    93.9 KB · Views: 371

Beetle

Duly Registered Boozer
Local time
Today, 08:03
Joined
Apr 30, 2011
Messages
1,808
I wasn't trying to steer you in one direction or another, just wanted to make sure that you and any other decision makers in your organization are aware that if you want to run a true Access web application you will need Microsoft Sharepoint with Access Services. Whether you already own/purchase and maintain that yourselves, or you pay a third party hosting service.

The second link provided, I've read over as well. Having someone on site setup citrix /terminal services is not an option. In my opinion, I do not believe it to be wise that everyone gets a copy of the FE database Again not everyone will have the ability to have MS ACCESS.

Just FYI, I think you misunderstood the explanation of Citrix/TS. In this case the client machines do not need to have Access installed. In post #7 of the actual thread that is referenced in that link, where Pat says this;

I don't do the technical work to set up Citrix or TS but I can tell you that the admin must be instructed to make sure each user gets his own copy of the FE.

that means that each user needs their own copy of the FE within their defined workspace on the server. They would not need Access or their own copy of the FE installed on their remote laptop or PC. Again, just FYI so you understand the options.

Moving on to your web form, like I said before it's going to require two macros to accomplish what you could do with a few simple lines of code before. I'll try to explain the process as best I can here, but I have also attached a small sample db so you can see this in action.

First, the data macro. To create or edit a data macro you need to have the table open, then go to Table Tools/Table and click the Named Macro drop down (like in the image below);





The logic behind the data macro that you need to create is that you need to create a parameter to store the value that you need in order to look up the appropriate record in the table. The value itself will be supplied by the second macro and in this case will be the Contract_No from the combo box on the form. Then, for each field value that you need to return from the record associated with that Contract_No, you will set a Return Variable (SetReturnVar). These return variables will supply those values to the second (embedded) macro in the form. One important thing to note here is that you need to make sure you set the return variables from inside the Look Up A Record In block The data macro would look like the following;





Next, at the form level, you create an embedded macro in the After Update event of the combo box;





This macro will run the data macro that you previously created (using the RunDataMacro action) and supply the parameter. You will then set the value of each unbound text box using the values that are supplied by the ReturnVars from the data macro. This macro would look like;





The attached sample db contains one table and one form with a combo box and three unbound text boxes.
 

Attachments

  • EditMacro.jpg
    EditMacro.jpg
    78.9 KB · Views: 4,298
  • DataMacro.jpg
    DataMacro.jpg
    73.9 KB · Views: 4,555
  • Form1.jpg
    Form1.jpg
    53.7 KB · Views: 4,737
  • EmbeddedMacro.jpg
    EmbeddedMacro.jpg
    60.5 KB · Views: 4,416
  • WebExample.accdb
    412 KB · Views: 535

finneyz

Registered User.
Local time
Today, 10:03
Joined
Dec 27, 2012
Messages
51
Beetle what a response, Thank you so much first of all.
I saw this last night and wanted to get in touch with you. I read the other posts. in the other link. #7.

You may or may not know this but setting up a citrix system if the user performs work on the DB, the shared db with multiple users working on this db at the same time, wouldn't it effect the performance rate of the database. What about connection rate? I suppose that depends on the users location. I've never set up anything like that personally. Seeing that its $125 a seat or database? Again, not sure of getting something coordinated (cost factor too)

would this work in a osx environment? that just brings up another question too.

I was also looking at Enterprise Class Databases. but that looks like its on the Oracle side of things

Again my concern with the terminal services part is users having logging "in" issues.
Again, users will "not" always be "on location" where the DB is located.

I am going to try your advice on he macro thing. Its been difficult so I appreciate your advice and thoughts.
 

finneyz

Registered User.
Local time
Today, 10:03
Joined
Dec 27, 2012
Messages
51
my my how different it is than VB. just going over it right now.
I was able to get a message box working. thats about how far I had gotten with this.
Honestly there is not much out there for macro conversation. And with Comobox boxes and list boxes.
A few here and there and from Albert and I found another guy from the UK his videos were very supportive.

I do have a question. in the setreturnvar: it must be a table not a query? The expression that is expression=[table1].[Contract_Name]
 
Last edited:

finneyz

Registered User.
Local time
Today, 10:03
Joined
Dec 27, 2012
Messages
51
Beetle Again thank you. It worked great.
One weird WEIRD thing I noticed is that the record selectors were turned off. I was unable to move to the next record. I created another form and put the same data in. Not sure what I may have skipped over in the property sheet.
<sigh>I think I need a drink.
 

Beetle

Duly Registered Boozer
Local time
Today, 08:03
Joined
Apr 30, 2011
Messages
1,808
Honestly there is not much out there for macro conversation. And with Comobox boxes and list boxes.
A few here and there and from Albert and I found another guy from the UK his videos were very supportive.

You're definitely right about that. Other than Albert Kallal, I've seen almost nobody out there that is offering advice in the various forums on understanding the new macro system for Access web applications.

I do have a question. in the setreturnvar: it must be a table not a query? The expression that is expression=[table1].[Contract_Name]

Yes. With a data macro you get the values directly from the table. If you needed a value from a different table then you would create another data macro for that other table that would return the value you want so that you could then use that value somewhere else (i.e. in another macro). There are different types of variables as well (ReturnVars, TempVars, LocalVars), each with it's own context in which it is typically used. I'm still learning some of this stuff myself, but I've at least grasped enough to be able to help a few people in the forums.
 

finneyz

Registered User.
Local time
Today, 10:03
Joined
Dec 27, 2012
Messages
51
thanks again. I just dont understand why its so much harder for this crap than VB. its like walking on hot coals. with your hands!
 

Beetle

Duly Registered Boozer
Local time
Today, 08:03
Joined
Apr 30, 2011
Messages
1,808
I just dont understand why its so much harder for this crap than VB.

You have to keep in mind that an Access web form is intended to run in a browser. Furthermore, it has to run in any possible browser. There is no way of knowing if a remote user viewing your form in a browser over the internet is going to be using IE, Firefox, Chrome, Safari, etc. Anything you do in a web form has to be able to be interpreted by any browser. Browsers cannot interpret VB code, nor can they understand things like form references, built in Access functions, things like that. This means that for most all types of data manipulation, the process has to be performed elsewhere (like in a data macro at the table level) and the results simply returned to the form (and by extension the browser window).
 

Jamang

New member
Local time
Today, 07:03
Joined
Aug 26, 2013
Messages
6
I have followed this web combo box and this is what I am looking for, however my question is how do I do a compare using this dropdown web combo. I tried to re create the dropdown 3 times and wan't able to display the form for the second or third dropdown. Can someone help me?

Thanks,
Jamang
 

Users who are viewing this thread

Top Bottom