VBA To Get Value From Combobox And Make It Run A Macro?

Sep 7, 2012

How can i get vba to do this.When i click a button on the main form the vba code will execute and get the value from the combobox ie TE4700 and locate the macro with the same name ie TE4700 with reports in then it will run the macro and print off the reports.

View Replies


ADVERTISEMENT

General :: Get Value From Combobox And Make It Run A Macro?

Sep 7, 2012

How can i get vba to do this.

When i click a button on the main form the vba code will execute and get the value from the combobox ie TE4700 and locate the macro with the same name ie TE4700 with reports in then it will run the macro and print off the reports.

View 1 Replies View Related

How To Make It With Macro

Feb 11, 2008

i have problema when i need to make filter form 2 filter the output (report)
i need macro code (only)
how i make filter for ex.
names in reports
for example :
i need to write MICHAEL in Form and press button
it bring to me all fileds that start with MICHAEL
just it
plz reply 2 me

View 3 Replies View Related

Howto Make Combobox Selections Appear In Ascending Order

May 19, 2006

Hello friends,
Please can anyone tell me how i can make the selections in my combo box (combo is bound to column1 of a table) appear in ascending order, by name (column2).
I.e. It's bound by column 1 (with is the Id#), but i want it to appear in ascending by column 2 (Usernames) to make selections easier. Please help :)

View 2 Replies View Related

Forms :: Select Via Combobox - Make Numerous Controls Visible

Sep 18, 2013

I have a form where i select via a combo box if a product has been inspected, if it has, additional controls are then made visible.

If Me.Inspection_Completed = "Yes" Then
Me.Date_Inspection_Comp.Visible = True
Me.Date_Inspection_Comp = Me.Dateinsp
Me.Inspector.Visible = True
Me.Qty_Inspected.Visible = True
Me.OK.Visible = True

[Code] ....

I tried to put this in a function so i could call it on load, or on current etc, but cant seem to get it to work, apparently you cannot use the me. in a function.

View 4 Replies View Related

General :: Using Combobox Selection In IF Statement To Make Another Text Box Visible

Aug 28, 2012

I have a combobox [CBreason] that reads from a table to show me why someone is gaining access to the building.

One of the options is "Incident".

When incident is selected I want a textbox [TBIncidentNo] and a button[BIncidentDup] control I made to appear.

I thought that the code:

If Me.CBReason.Value = "Incident" Then
Me.CBIncidentNo.Visible = True
Me.BIncidentDup.Visible = True
Else
Me.CBIncidentNo.Visible = False
Me.BIncidentDup.Visible = False
End If

Placed in the after update action of the CBReason box would sufice but it doesnt work

I'm guessing the value is not recognised fro some reason but i cant work out why. There is no error message or issus, it makes the box dissapear when there is no entry but no change for selecting incident.

View 3 Replies View Related

Modules & VBA :: Write A More Complex Macro That Will Start Another Macro At Preset Time

Dec 8, 2013

I am trying to write a more complex macro that will start another macro at a preset time, however I am getting stopped at the first hurdle - getting a macro to run another macro.

Here is the code i am using at the moment, all I want to do currently is click the first button, then get the second macro to execute. But no luck, getting error 2157 "cannot find the procedure"

Code:
Private Sub Command3_Click()
MsgBox "1st macro running", vbExclamation, "Note"
Application.Run "teststart1"
' Application.OnTime TimeValue("19:55:00"), "teststart1"

[code]....

View 1 Replies View Related

Forms :: Update Row-source Of Combobox Based On Value Selected On Another ComboBox?

Apr 26, 2015

I am trying to use a combobox called Manufacturer to select which table the combobox called Model gets it's rowsource from using the code below.

Code:

Private Sub Manufacturer_AfterUpdate()
If (Me.Manufacturer.Value = "Siemens") Then
Me.Model.RowSourceType = "Table/Query"
Me.Model.Recordset = "SeimensTable"
Me.Model.RowSource = "SELECT Model FROM SeimensTable"
Else
If (Me.Manufacturer.Value = "Samsung") Then
Me.Model.RowSourceType = "Table/Query"
Me.Model.Recordset = "SamsungTable"
Me.Model.RowSource = "SELECT Model FROM SamsungTable"
End If
End If
End Sub

But when I run the form and select Manufacturer. Combobox Model remains empty. tell me what I'm doing wrong?

View 5 Replies View Related

Saving Contents Of Combobox As String, And Inputing In Another Combobox

Jan 13, 2005

How would I modify multiple comboboxes in subforms at the same time. For example.. In main form ComboboxA user selects 1992, Combobox1 in subform1 is also changed to 1992, as well as Combobox2 in subform 2.

Whats the best way to do this?

View 2 Replies View Related

How Can I Filter One Combobox Based On Another Combobox Selection?

Apr 22, 2005

I have 2 comboboxes, the first one is called "activity", whereby I have 3 options to choose from, and the second is called "level".

When I click an "activity", for example Drawings, I want the "level" combobox to list a unique set of options for that category. and if I click on a different "activity" for example Planning, I want the "level" combobox to show a completely different set of options.

If anyone can give me any help on how to do this then I would be very grateful!!

Thanks

Angela :eek:

View 2 Replies View Related

Combobox Based On Previous Combobox

Jan 25, 2006

I've tried searching the forums and haven't found quite what i'm looking for. I would like to be able to change the source for a combobox based on another combobox. The simplest way i can summarize that is i want to be able to choose A or B, depending on my choice i want another combobox to display all the values that A or B can have.

Thanks

Jim

I'm not sure I worded that very well. :(

View 1 Replies View Related

Combobox Depends On Input Of Other Combobox

Feb 25, 2008

Hey all,

I've read some tutorials on this sort of thing, but I can't seem to piece it all together to achieve what I want.

I have a table Products that contains the fields Product, Size and Brand. I also have a form, frmProducts, that has a combobox linked to each of the fields in the Products table. I want to be able to select a product from the first combobox, tab to the Brand combobox and have only those brands associated with the product already selected.

This is how I think it should work:
1.ComboBox1 selects productA
2.ComboBox2 takes its options from a query that searches Products table for all instances of productA and displays all available brands. brandA is selected.
3.ComboBox3 get its options from another query that searches for all instances of productA that also have brandA and displays all available sizes.

What I'm having trouble with in particular is passing the data between queries. For example, I can't figure out how to tell the query to search for all instances of productA when its defined by the first combobox. Do I have to store it as a variable somewhere?

I hope I've been clear.

View 6 Replies View Related

Column Names. Can I Make The Name Field "higher"? (to Make Room For More Lines)

Sep 25, 2006

I'm currently working with a form, which is in datasheet view. I have many rows which are combo boxes (yes/no), and the name is rather long. So each line (each row) spreads on to 2-3 pages to the right.What I would like to do is make the namebar, on top of every column, a little bit higher, so the name would be split into two lines, or three. Allowing me to make the width allot smaller.Here is an example of my problem:http://213.213.137.96/~terminal/columns.jpgSo my question is, can I change the height of the column name? Or is there some trick I can use?regardsFrímann Kjerúlf

View 1 Replies View Related

General :: Make A Copy Of BE File Rather Than To Make A Copy Via Code

Nov 26, 2012

Would it be ok just to make a copy of the BE file (every so often) rather than to make a copy via code?The user can then just paste over the original if it becomes corrupt.

View 4 Replies View Related

Run A Macro On First Use.

Dec 5, 2005

Hi.
I have a macro (that runs a bat file) that I would like to run for the first time ,and only the first time that a form is run. The bat file will then copy over certain files the db needs.
Is this possible?

Thanks.

Frank.

View 1 Replies View Related

Macro

May 19, 2005

I have a database and in order to get the correct values you need to run a few queries/make tables/delete tables ect. I was wondering if there was a way to code something so that on command click button it would run through all the neccessary steps so people dont have to manually do this.

View 1 Replies View Related

Do I Need A Macro For This? If So, How?

Mar 31, 2006

Hi,

Here's a sample of the database that I'm working on. I'm trying to help teachers take attendance of all of their students and so have the following tables.

tblAdmin - List of Teachers and their IDs
tblAttendance - Courses, Student IDs, the Date and the Status (tardy, etc..)
tblCourseInfo - List of Courses and the Teachers teaching the course
tblEnrollment - List of the Courses and the students enrolled in them
tblStudents - Student IDs and their names

The form that I want is a "Course Information Form" that will

(1) Display all the students enrolled in their course
(2) Allow the teachers to take attendance everyday while keeping all the previous records

I've attached my sample database. I really appreciate ANY help any of you can suggest.

Thanks :)

View 13 Replies View Related

Macro

Feb 27, 2006

I am running a Macro that is running 3 query and saving inbetween each query.
My issue is that when the macro runs I have to hit ok when the message boxes pop up saying "its about the run a Query" and then again when it says "your about to update the records". These two messages occur for each query and save. So I have to hit OK 6 times

Is there a way I can set the macro to NOT show these message boxes?

THanks in Advance

View 9 Replies View Related

Macro Problem

May 2, 2006

Hi all,

I usually search for the answers to my problems, but as im not sure what the problem is i havnt been able to do so here.

Basically i have a pretty simple database, it works fine in the UK. The company i have designed it for are moving to Budapest, i have just had an email this morning saying an error message pops up when the try using a form, i have attached the message. The macro just runs a query based on a table in the database asking the users to choose a record number edit. Im assuming it must be something to do with is being used in Budapest as it works fine here, but they are accessing it the same as they would do here, just from a different location.

Any help would be appreciated, thanks

View 5 Replies View Related

Autokeys Macro

Dec 2, 2006

I use an autokeys macro to allow users to openforms with a hotkey directly without going through the menu system.

I would like the users to be able to modify their own setttings for this, but I could not find a way of writing to the macro autokey table.

Anyone know of a way?

View 4 Replies View Related

The Macro Can Not Run In Some Computers

Jul 30, 2007

I have a program thats work perfectly in some computers useing the network but when i try to open it in other computers i get an error and when i try to debug the error it highlit the line that i am calling the micro that open the mainform in it, i hope some one have an idea for what is going on with the program

View 12 Replies View Related

Macro In Access

Dec 3, 2007

Hi,

Task: to extract data from table 1 of a database (tied to form 1) to create a record in another table 2 of the same database (tied to form 2).
Besides, I need to make it simple to use for an end user.
On the form 2 I have a command button that activates macro. Macro makes a query to run and extract data from table 1 and append a table 2.
Now I want the user to see the record on the screen (form 2) that has just been created. For that purpose I add "go to last record" step in the macro.

Problem: that doesn't work. :) For some reason it brings back same record from the middle of the table which is not the last. And what is even more interesting is that it doesn't tie to the record ID on the bottom of the screen (access generated).

Challenge: the record ID field in the table 2 is a primary key auto-numbered field (i know this is not perfect but I am not the one who created the database) and some records have been deleted over time. Might that be connected to that or that is something else?
Thank you!!

View 1 Replies View Related

Programming With Macro

Jan 11, 2008

I have inserted two combo box in the form with lookup in the table. Now I want to select values in these boxes and filter the records having those values on click of a command button placed on the form.

How can it be done without using VBA? Is it possible with use of macro?

Kindly guide.

View 2 Replies View Related

Need Help Finishing A Macro

Mar 25, 2008

I hope you might be able to help.

I've managed to successfully setup my first Access database.

I have imported data from Microsoft Excel into an Access Database and Table within that (EmptyHomesTable).

The data relates to empty properties and every month at work we receive a list of empty homes in the month. Every month, this new data will be imported into a TemporaryImportTable.

I am then running an update query to compare the data in the EmptyHomesTable with TemporaryImportTable and 'close' those which are no longer empty (i.e. update their status in the EmptyHomesTable if the account reference number doesn’t match).

I am then running an append query to compare the data in the EmptyHomesTable with the TemporaryImportTable and add any new empty properties (i.e. add those which aren’t in the EmptyHomesTable by looking at the account reference numbers and adding them if they don’t match).

This gives us a working database of empty properties but doesn't delete those which are no longer empty (rather they are marked as closed).

What I'm trying to do is to run a Macro to automate all of this on a monthly basis.

Macro is as follows:

1. Delete Query to delete the data in the TemporaryImportTable but keep the table structure;
2. TransferSpreadsheet to import the latest Microsoft Excel file into TemporaryImportTable;
3. Update Query to close properties which are no longer empty in EmptyHomesTable;
4. Append Query to import those new empty properties in EmptyHomesTable;

The macro almost runs fine but I have a couple of questions to help finish it:

a).I’ve run the macro to update the February list to the January list which works fine. Running the macro to update the January and February list (combined) is almost fine but I’m 2 entries out. I can’t manually check as we’re talking about 1,500 entries. Is there another way?

b). Is there any way for the TransferSpreadsheet query to ask at each time of running the macro for the location of the Excel spreadsheet or do I need to go into the macro every time and change the file location?

c). One of the fields in the table is empty date (i.e. the date the property became empty). Is there a quick way to filter the entries before a certain date (i.e. only show those empty before 30 September 2007 for example)?

Thanks for your help.

View 3 Replies View Related

Macro Writing

May 17, 2005

Hello,

I have a procedure which I undertake and wonder whether it can be automated in any way.

I have a field on a form for Purchases (frmPurchases) for a Purchase Order number. To get the order, I click on a command (cmdpo) which opens another form and clicking a command on this form (cmdgetpono) produces a unique Purchase Order number. I then manually copy the number given and paste it into the field on frmPurchases (PONo).

I have not used Macros before but cannot see that there are the options to achieve this. If someone could suggest the ones I should uses fro the list it would be appreciates.

Alternatively, is there another way of looking at this?

Thank you

Lin

View 2 Replies View Related

Msg Box Before Macro Start

Dec 14, 2005

Hello,

I have a button that runs a macro to delete records in 12 tables. I want to create a message box before that macro runs warning that you are deleting records in 12 tables and are your sure you want to run the macro.

I need a message box with an ok and cancel button. Where do I put the msgbox funtion in this code?

Thanks !!

This is my code:

Private Sub cmdRunDeleteMacro_Click()
On Error GoTo Err_cmdRunDeleteMacro_Click

Dim stDocName As String

stDocName = "mcrSemesterStartRecordDELETE"
DoCmd.RunMacro stDocName

Exit_cmdRunDeleteMacro_Click:
Exit Sub

Err_cmdRunDeleteMacro_Click:
MsgBox Err.Description
Resume Exit_cmdRunDeleteMacro_Click

End Sub

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved