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 Replies


ADVERTISEMENT

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 1 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

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 :: Add Table Macro?

May 20, 2014

im working on a project , and i need to add a sale and delivery option like a table connected to a member customer with product list and price and in the end put all together in a report. Like a bill.

View 1 Replies View Related

General :: Task Scheduler To Run Macro?

Mar 19, 2014

Just got a new Windows 7 computer and installed Office 2013. I have a report that saves itself as a pdf in a temp folder and then attaches the pdf to an email and sends it out. I use a macro to run the report and everything works fine from there. I have a VBS file that runs the macro and clicking the vbs file makes everything work fine. the code is below.

When I tried to run it though the task scheduler it show as completing fine, but it doesn't. So I added a reference the vbs in a batch file (below) and output the logs to a temp file. After I ran the batch and opened the log I seen the message

Wed 03/19/2014 14:11:17.74 Username
C:Users*****DesktopAuto Reportsaragingrecent.vbs(1, 1) Microsoft VBScript runtime error: Permission denied: 'CreateObject'
Wed 03/19/2014 14:11:17.77

I turned UAC all the way down. turn off the virus scanner, and have local and domain admin access. I'm at bit a lose here. I had this working before but can't seem to remember how I did it. This is just one example I have several other reports that were schedule to run overnight, but they basically all use the same code and processes.

Code:
'launch macro
set accessApp = CreateObject("Access.Application")
accessApp.OpenCurrentDatabase "C:Users******DesktopAuto ReportsAgedTrialBalance.mdb"
accessApp.DoCmd.RunMacro "MCRecent"

[Code] ....

View 2 Replies View Related

General :: Run Macro On Word Doc Closing

Sep 25, 2012

is it possible to run a macro in access 2010 on close event of a word doc. i want to run an update query when i have sent some email. i want to first make sure i send the emails and the when i have finished close the word doc and then open query [QueryName].

View 2 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

General :: Key Value Violation With Macro Append From Spreadsheet

Mar 10, 2015

I am having problems with an append from a spreadsheet into a pre-populated table. I am using a macro to do this.

The table is in the middle of a hierarchy of tables. For example:

table 1 - Audit - key: AuditNumber & AuditName
table 2 - Process - key: AuditNumber & AuditName & ProcessRef
table 3 - Risk - key: AuditNumber & AuditName & ProcessRef & RiskRef
table 4 - Controls - key: AuditNumber & AuditName & ProcessRef & RiskRef & ControlRef
table 5 - Control tests - key: AuditNumber & AuditName & ProcessRef & RiskRef & ControlRef & TestRef

The front end of the database has a form for each table. Once you create an Audit in table 1 you can create multiple Processes underneath this one audit. Underneath a process you can create multiple Risks...... hence a hierarchy.

I am trying to append data to table 4 - controls. I have copied the format exactly into excel. I have also prepopulated the Audit, Process and Risk data in the required tables.

The reason I want this functionality is to enable team members to populate control information (oftentimes up to 25) in excel and then upload them easily into the database.

The macro I have created will work when created a new table. but when I point it at the existing table 4 - Controls I get the Key value violation error.

View 5 Replies View Related

General :: Macro To Prompt Depending On Checkbox

Nov 12, 2013

I need to display a message on a form after a record update has been done depending on whether a table field is ticked or not. If it is ticked I want one message if it is not ticked I want a different message, but here is the scenario.

I have a form and one of the options I have is to call up an address from a record in a table. I want it to display a message to advise whether there is a special requirement for delivery to the address, so in the table I have a checkbox field. If its checked, once the address has been pulled up I want it top advise 'special requirement' or 'no special requirement'.

I need to do this in a macro form, or expression form if possible as I already have an after update macro when that drop down is selected.

So on the dropdown list I have the following on the afterupdate function:

SearchForRecord
Object Type :
Object Name :
Record: First
Where Co0ndition - - "[ID] = "& Str(Nz([Screen].[ActiveControl],0))

That brings up the address from a record in my table onto this form, so what I want is if that record has got a tick the checkboxfield it prompts with a message and ok button.

View 3 Replies View Related

General :: Use VBA To Click A Button That Fires A Macro?

Sep 4, 2012

enable me to run some code before a button is clicked I want to be able to click a button via VBA code.Basically I used the auto button wizard to make an add record button.To ensure a shed loads of if checks and queries on the entered form data run I wanted to make this button invisible, then make a new button running code not embedded macros to run my checking module then click.

View 9 Replies View Related

General :: Macro To Manipulate Unstructured Data

May 5, 2015

I have some tables need to be imported to Access, which is not well structured. For example:

report
4/05/2014
from SQL server
Name ID Add.....
aaa 111
bbb 222

To be more specific,I have 4 csv files, that need to be imported into Access.

1. I'm building 4 linked tables so users can update the table as needed. Then run queries based on these tables to produce report. But maybe there's a better way? the file name and location might be dymatic, so anything like 'getopenfile' would be easier instead of linked tables?

2. These data need to be clean up first to become a 'database table'. (Delete first 2 rows, delete some columns, remove duplicates etc.) I know how to do them in VBA Excel, but never used Macro in Access before.

View 1 Replies View Related

General :: Create A Macro That Begins After Update

Apr 3, 2013

I have a tabular form that lists all the records (address book). I'm trying to have a combo box filter the records by selecting a contact type (employee, supplier, customer). So far I have the contacts displaying in the combo box.I've tried to create a macro that begins "after update". Its an ApplyFilter macro.

Where Condition = [Contact Type]=[Contact Type Select]

[Contact Type Select] is the combo box.

When I do this, a popup box appears. When I type in the item I want, it works. I want this done automatically.

View 1 Replies View Related

General :: Customize Background Of Message Box That Is Brought Up Via Macro?

Jan 8, 2015

Is there anyway to customize the background of a message box that is brought up via a macro or VBA event? It would be kind of fun to have a stop sign image in the background of a "save and close form" prompt.

View 6 Replies View Related

General :: Module Crashing After Changing Window Mode In Macro

Sep 10, 2014

We have been calling a main form to manage yacht races using a hyperlink/macro from a selection form which lists all the yacht races ..The main form was too big to fit on some screens so we changed it to pop up mode to allow it to be resized and use scroll bars. this works well when the form is opened manually and all functions run just fine

the hyperlinik/macro for race selection had originally been set up to call the main form in dialog mode but we have had to change this as it disabled the resizing of the form and the scroll bars..The macro tool doesn't offer pop up mode so i selected window mode = normal and the main form opens with a resizable window and scroll bars but all the functions called from this module now fail (error message = use of null value or similar and all the functions go into debug mode - the server is down and i can't access the system to get the exact details)

If i change the macro in the selection form back to window mode = dialog the functions work but i lose the resizing of the main form and and the scroll bars.

View 1 Replies View Related

General :: Macro To Create Table Fields From Another Tables Records

Jul 10, 2012

I think what I want is:

1 table(1): record of people & contact details
1 table(2): list of events with check box's with the names of people from the other table
1 report: listing how many events people have attended.

When I add a new person to table 1 I want a field to be added to table 2 in the form of a checkbox, also when I delete this person I want this field to be deleted in table 2.how to make this an automated process.

View 1 Replies View Related

General :: How To Write A Macro To Display Only Grouped Items In Excel

Dec 11, 2013

I'd like to use a macro to display only those items which stay as a group in "Old Project Code" (black font) and filter out those which are singles in "Old Project Code" (red font) as shown below extracted out from a worksheet called "Project" in Excel.

New_Project_Code Old_Project_Code
62409 AU028
62410 SAU029
62411 ZZZ001
62963 ZZZ010
62964 ZZZ010
62965 ZZZ010
62966 ZZZ010
62967 ZZZ010
62412 ZZZ050
62973 ZZZ061
62974 ZZZ061
62975 ZZZ061

1. The color wasn't there in original sheet. It is here only for demo purpose.
2. Data are changing dynamically, so need a macro in place to catch a snapshot at the time of macro is firing.

View 1 Replies View Related

General :: Create Dataset With Ability To Search Through Macro Form?

Feb 23, 2013

i orginally thought i should do this in excel but i think when the dataset becomes larger and i want to eventually get it on the web - i thought its access i need?

i have created a mini dataset as an exmaple of what im trying to explain..i have in first column the objects, and columns after this are the elements needed to make the object (i have just labelled the element titles a b c etc - there will be LOTS of elements once i get the dataset created). so if i had a red blue green cream elements - a search would bring back both lights and lamps that i am able to make.

object A B C D E F G H
lights red blue green cream
lamp red blue green cream
garage red blue green cream yellow brown purple pink
house orange white green blue red black
garden orange white green blue red
garden house orange white green blue red

is there a way of creating a search lookup to this kind of information? a form which you type the criteria in and it brings back what you can make? if i was one element away from an object could I use a wildcard function to say, if you had black you could make a house?? etc

View 3 Replies View Related

General :: Macro To Email A Form Once Condition Met - Open Outlook From Access

Apr 10, 2013

I have a macro set to email a form to a person once a condition is met. This works fine but I've discovered that Outlook (2010) has to be open BEFORE this macro is invoked.

I wanted to add a step to the macro before the one that makes it email that basically says to open Outlook.

I have tried the RunApplication macro, but I apparently am not getting the path right. I don't understand what the problem is.

I accidentally dragged Outlook to my desktop and therefore created a shortcut from my Start Menu, but now when I go to Microsoft Office in my Start Menu, Microsoft Outlook isn't one of the options. I can't find the path to where it may reside now.

I am using the path to the shortcut on my desktop.

C:UsersJust MeDesktopMicrosoft Outlook 2010

What else am I supposed to do?

View 8 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

General :: Combobox Display -1 For Yes And 0 For No

Jun 25, 2013

I have a combobox on a form linked to a table. The format of the column in the table is Yes/No. The form which inputs into the table is also set to Yes/No.

However of the form below, even though the combobox is set to Yes/No, when you open the box it displays as -1 for yes and 0 for no.

How has this happened?

View 7 Replies View Related

General :: Get Value Combobox / Textbox That Does Not Have Focus

Sep 21, 2012

I am trying to get the value of a combobox after selecting an "OK" button but get "You can't reference a property or method for a control unless the control has the focus." Most would probably say use .Value but when I press "OK" I am prompted for a value, or as in another case get Null.I tried setting the focus prior to the violating line of code, but no go.

Example:

Code:
Private Sub viewByRegionOKButton_Click()
DoCmd.OpenReport "byRegionReport", acViewPreview, , "RegionName = '" & regionComboBox.Text & "'"
End Sub

View 4 Replies View Related

General :: Default Value Combobox But Not In List

Jun 11, 2012

(I'm upgrading an old database)

I have a combobox who lists te values of a table.

In that table are say: 5 records filled with a,b,c,d,e.

In my form i have a combobox who is default filled with a blank field, but i can select a,b,c,d or e.

If i select nothing in the combobox, the value has to be set at "0"

But i cannot add "0" as a value in de table of the dropdownlist.

if i can get the value default for "0" i'm happy, but if i can display the "0" as default in the combobox, i'm very happy.

View 2 Replies View Related

General :: How To Get Value From Combobox And Link It To Print

Sep 6, 2012

What i need to be able to do is write vba to find the value inside the comboxbox and then either:-

1. Run a macro with the same value that is in the combobox
Or
2. Run a set of reports and print them off but are linked to the combobox value.

The combobox name is ODTyper
The combobox control source is ODType which is a field in TblType
The combobox row source is SELECT [TblType].Model FROM TblType;
The value inside the combobox are in the format of TE4700
The name of the macros are in the format of TE4700
The Main form is called FrmOrderDatabase.

Plus somehow i need to get the value of the combobox and link it to print off the correct reports.

View 9 Replies View Related







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