General :: Coding A Button Special Function

Apr 23, 2015

I have created inventory databases for both my job and personal use. I do not understand coding. I either need a good hand-holding with simple, detailed instructions or I need to hire a code person.

A button in my form that can be coded to ... When clicked ...

___ open a browse window of hard drives,
___ allow user to choose any single image for selection,
___ copy & paste selected image's location to a table field.

NOTE: Table field will be used to connect to image place holder on form with control source to make the image seen.

View Replies


ADVERTISEMENT

General :: Add Button To QAT To Run Sub / Function

Dec 4, 2012

I'm trying to add a couple of buttons to the QAT to run public sub's saved in modules within the DB but for some reason they are not showing when I try to customise the toolbar?The sub's are fairly straightforward (they just open forms) and are saved in a module within the project :

Code:

Option Compare Database
Option Explicit
Public Sub NewEntry()
DoCmd.OpenForm "DataEntry"
End Sub

[code]....

But when i try to add them to the QAT, they are not visible?

View 1 Replies View Related

Coding Command Button To Add A Few New Records To A Table

Nov 2, 2006

I have 2 tables, one has a list of comments indexed by numbers.

The second table will be populated with numbers that correspond to the first table based on usage of the form that I'm about to describe.

The form contains several check boxes. Each corresponds to a comment from the first table. If 3 of the check boxes are selected when the command button is pressed, I want three separate new record entries to go into the second table and the data that I want entered is the text in the label that is next to each check box on the form. After the records are added to the table, I'd like to reset the check boxes.

I simply cannot figure out how to code the button to do this.

View 3 Replies View Related

Modules & VBA :: Adding Button With Special Functionality - File Location In Database Path

May 28, 2014

In the access form I want to add a button with a special functionality.

After clicking "Select file" button special window should be open (or something else). It should give user a possibility of files locating (doc, pdf, rtf, txt ...).

After selecting the file and confirm the choice in the table "File_location" in database path to the file should be saved .

View 4 Replies View Related

General :: Retrospectively Imposing Coding Standards?

Dec 17, 2014

I am probably not alone in having a database which has grown over time in a slightly undisciplined way, in that standards have not been consistently applied. It's quite a large database by my standards : 20+ tables, 50 queries, 40 forms/subforms, a handful of reports and lots of VBA. It's working fine so there's no way I can justify restarting from scratch, but it can be hard to maintain, particularly when working out the type and scope of fields, variables and controls.

How to introduce a consistent naming convention retrospectively ? This seems easy enough within modules, it's identifying where things are used within forms that has me worried. I would want to use the Reddick conventions.

View 4 Replies View Related

General :: Union Query And Form Coding

May 14, 2013

I have 2 tables, (will just call them tbl1 and tbl2 for this example) each with a column AppNumber. The AppNumber may appear in both tables or individually in either one.

I want to be able to show, or flag, on a continuous form which Appnumber's appear on tbl1, tbl2 and on both. This is so the user can click a button and bring up another form with more data relevant to the AppNumber.

I have written a union query to show all results from both tbl1 and tbl2 which contains 4 fields AppNumber, DateApp, Surname, Forename but I can't tell from the query results what AppNumber's appear on each table. Here's what I would like to show on the continuous form:

AppNumber DateApp Surname Forename tbl1 tbl2 Both
12345 11/12/2012 Simpson Homer Yes No No
56565 01/04/2013 Stallone Sly No Yes No
89788 03/03/2012 Rambo John Yes Yes Yes
89745

View 2 Replies View Related

General :: File Import With Special Heading

Aug 11, 2015

File import with special heading

ABC. or 123.

First time the file import, system will ignor the "full stop" into the table. But next time when I try to import to update the table, system error can not identify the heading.

View 2 Replies View Related

General :: Removing Special Keys Does Not Work

Nov 23, 2012

I want to hide the Navigation Pane as well as the full menus and "special keys". I do that by going to the options tab and removing the appropriate check marks.However, it does not seem to work! No matter how many times I do it, if I hold the shift key, the navigation pane is still there.

View 14 Replies View Related

General :: Find Special Character From Right Side

Sep 23, 2013

I have a text such as "Arun-Halyal-12". I need to extract "12" from the text in MS Access query. What formula i have to add in query to get "12".

View 3 Replies View Related

General :: Special Characters In Table Values

May 1, 2013

My database has several tables (and queries) that have fields that contain people's names. Some names, like O'Neil, contain apostrophes. Other fields contain couple names, like Tom & Laura Jones. Both the ' and the & prevent queries, forms, and reports from working correctly.

View 3 Replies View Related

General :: Creating A Special Recorded Mail Database

Jul 31, 2012

I am trying to create a Special Recorded tracking database where a member of staff will log the tracker number into the database and then at a later date someone can come and update the data, what I want to do is scan the tracker barcode with a scan gun and its details appear for updating, I can do this part but when I make any amendments to the data it doesn't save the new data and I don't know why? I am using a combobox to display the tracker number and me.text1.value = me.combo4.column(1) and so on and so forth to display the data, when I change this data it doesn't save.

View 1 Replies View Related

General :: Text Box Event Coding - Jump To Next Field After Using Barcode Scanner

May 20, 2015

I am creating a inventory database for work. I am trying to get the cursor to jump to the next text box for data entry using a barcode scanner. I have a limit on how many characters there can be in this field but yet even after it is all filled the cursor stays in that same field. I am fairly new to access, especially in code building. Do I use "After Update" under "Event" in the "Property Sheet"?

Capture.PNG
Capture1.PNG
Capture2.PNG
Capture3.PNG

View 4 Replies View Related

Modules & VBA :: Run A Function On Button Click

Sep 24, 2013

I try to run a function off of a button click.

The code is

Private Sub Command_Click()
Run fuctionname()
End Sub

The code is ran, but then I get a msg box : Run-time error '2517':

Microsoft Office Access can't find the procedure '.'

View 5 Replies View Related

Button Function In Form To Generate Report?

Aug 8, 2006

Hello,

I am trying to see if the following is possible. I have created a form in my database that tracks how many thank you letters I have sent out with a "check for yes" box.

On records where there is no check I want to create a button beside that says "Print Thank You Letter". It would then generate a form based on that certain customer's information.

Is there a way for me to do this? Also, will the report automatically generate that person's information found in the record?

Thanks,
MACCESSGIRL

View 1 Replies View Related

Modules & VBA :: Function Returning Max Value - Button Click Event

Dec 8, 2014

I have a table EmployeeInfo containing three fields

EmployeeId
Name
FatherName

I have created form for this table.

I do not want to use autonumber for employeeid for some reasons. I want to place a button along employeeid test box on form.

User will click on the button it will get max employee id from employeeinfo table and add 1 and copy it into employee id text box.

What will be the code for button click event.

View 2 Replies View Related

Forms :: Setting Button OnClick Properties To A Function

Feb 3, 2015

I am try to open a form from another and set a button's OnClick properties to a function and I keep getting an error message..Run-Time Error 2450Cannot find the referenced form ..And this is the code I am using.

Case 113
DoCmd.OpenForm "frm_View_Defects_On_Screen", acNormal
Forms!frm_View_Defects_On_Screen.RecordSource = "qry_1st_Adv_Report_Combination_111"
Forms!frm_View_Defects_On_Screen.btn_Back_to_repor ts.OnClick = JumpBackToAdvancedReport()

I just don't want to create another form just for one button.

View 3 Replies View Related

Modules & VBA :: Adding Secondary Function To Existing Command Button

Nov 12, 2013

I have a command button that basically saves the record that i just finished entering. here's the code:

Private Sub cmdAddAnother_Click()
On Error GoTo Err_cmdAddAnother_Click

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Exit_cmdAddAnother_Click:

[Code] ....

What I'd like to do now is add a second function that will make all the controls on the form go to null after the record is saved. so the user can start from scratch and add another record.

I tried adding me.refresh right before "end sub" but that didnt work.

I tried adding "me.controlname.value = null" for every control on the form, and that didnt work either.

I also tried adding this code that i found on bytes.com:

On Error Resume Next

Dim ctl As Control
For Each ctl In Me.Controls
ctl.Value = Null
Next

That didn't work either.

View 4 Replies View Related

Modules & VBA :: Dynamic Button Function And Single Field Report

Jun 25, 2013

I'm still learning Access 2010 and having issues getting my buttons to work. I'm working on a simple address database.edit/save button. On form load, my fields are locked and my button will read "edit". After clicking, my fields are unlocked, my search features are locked, and my button reads "save" just how I need it to. The issue happens when I try and save the field edits, lock fields, return search features, and get button to read "edit" again. I know I need to add some code into what I already have, but I'm running into a wall as I have tried many options to get it to work. Here is the code for this button:

Code:
Private Function Lockdown() 'locks controls at load
Dim tb As Control
Dim cb As Control
Dim subf As Control

[code]...

Second issue is with my report button. I have not been able to get this to work once. I have done many searches on single record reports, and have found the same code every time. I added that code into my database, but can't seem to get it to work. In my database there are two address (shipping and work location) which I would like to print out together. I have the work location on the main form and the shipping on a subform. There are and upwards of 150 locations I will have in my database, Here is the code I'm working with:

Code:
Private Sub cmdrptadd_Click()
Dim strReportName As String
Dim strCriteria As String

[code]...

View 3 Replies View Related

Modules & VBA :: 1 Function For Multiple Buttons / And Using Arrays For Button Colors

Mar 4, 2014

Question 1:

I am attempting to make a macro to pull information based on a clicked button to provide information to another form. While my example below will be rudimentary, I am attempting to create so that it can be applied to 450 buttons, hence the need for it to be a macro and not simply code per button.

For example if I have 3 buttons, captioned: red, green and blue. If I click on the blue button, it will open another form with a text-box that will say 'blue'. Likewise, if I click the red button the text-box will be changed to 'red'.

In the code below the section that I need to change is: Command1.Caption. Using this data I can pull from the one button to create the value, but I need it to be based on an OnClick or something in order to pull the value from the right button.

Example:

Function Macro1()
On Error GoTo Macro1_Err
DoCmd.OpenForm "Form2", acNormal, "", "", , acNormal
Forms!Form2!Text0.Text = Forms!Form1!Label0.Caption
DoCmd.GoToControl "[Text2]"
Forms!Form2!Text2.Text = Forms!Form1!Command1.Caption

[code]...

Question 2:
I am trying to use a query to change button colour on the basis of values stored in a table.What I want to do is change the button background after comparing the button name to the same variable in a table, and determining another variable.

IE:
Button1, Button2. In table: Button1, Val = Y, and Button 2, Val = Z

Pseudo Code:
Array: From Button1 to Button2
Query for Button1 against table
If Val = Y, Button1.background = red
Else if Val = Z, Button1.background = blue
Else Button1.background = black
End if

View 4 Replies View Related

Forms :: Function To Enable / Disable Button Depending On Files Imported Or Not

May 20, 2015

I have 3 macro importing 3 files, and then another button to process those data.

So, I need a function to enable/disable the button depending on the files have been imported or not.

View 1 Replies View Related

Forms :: Command Button On Click Function - Search By Hedging Program

Jun 26, 2014

I have a command button using this code:

If Me.Setfilter.Caption = "Search By Hedging Program" Then
Me.Filter = "Hedging Program"
Me.FilterOn = True
cmd.Setfilter.Caption = "Don't Search By Hedge Program"
Else
Me.FilterOn = False
cmd.Setfilter.Caption = "Search By Hedging Program"
End If

Hedging program is the column from the table I am trying to filter, it is a yes/no column. I want it to return all yes values in my query if it says search by hedging program and if it says Don't search by hedging program I want it to disregard the filter. I also have it set so that when I click the button it changes the caption from one to the other. So I don't know if I really need the cmd.setfilter lines because they may do the same as my command button on click function.

View 14 Replies View Related

Tables :: Find Record Button Added To A Form To Adjust Search Function

Apr 6, 2015

Is it possible on the Find Record button added to a form to adjust the search function so it defaults to a specific box on the form? I have a form for tracking employee's and on my Find Record button I would like it to default to the Last name instead of the Record number.

View 3 Replies View Related

General :: How To Use IsNumeric Function

Jul 30, 2012

I want to make my Courseid field visible in my form based on whats entered in my StudentID Field.I've used the following code but i'm getting an "Else Without If" error:

Code:

Private Sub Form_AfterUpdate()
If Me.studentID = "Pending" Or "Rejected" Or "pending" Or "rejected" Then Me.Courseid.Visible = False
Else: Me.Courseid.Visible = True
End If
End Sub

If the studentID is a number then i want the course to become visible but i don't know how to use the isNumeric function this way.

View 13 Replies View Related

General :: Run A Function On Exit

Jun 13, 2013

I want to run a function when my application closes. But it must run in all cases, so running it on the last form, or in a hidden form, is not good enough. Even if I'm in design mode with no forms loaded, I want it to run.

For background info - my app is locked down tight against clients poking around. I have got a way for me as developer to get into the "back door", and what I'm trying to do is make sure when I'm finished doing my stuff that the app is locked again without me having to remember to do it.

View 8 Replies View Related

Coding Not Right?

Apr 19, 2006

I have a Form that currently contains a checkbox that has the following OnClick event...
SELECT tblPlayerRegister.Surname,tblPlayerRegister.[Club],tblPlayerRegister.Age
FROM tblPlayerRegister
WHERE (((tblPlayerRegister.Age) < 11) And ((tblPlayerRegister.Club) = "Beaconsfield"))
ORDER BY tblPlayerRegister.Surname;

The aim of this is to select the Surname, Club & Age from the Table PlayerRegister where the Age is less than 11 and the Club is 'Beaconsfield' and then Sort in Ascending Order by Surname.
I get an error when I write this code and I don't know what I am doing wrong.
I am not very knowledgable with Coding but I have given it a go.
There will eventually be many checkboxes with different criteria and I don't want to do a query for every one.
Could somebody please advise what I have done wrong?
Thank-you for any assistance given.

View 5 Replies View Related

Need Some Help With Coding

Aug 4, 2005

Okay here is my code, I had thread open awhile back. In regards of exporting main form and subform to word. Here is the code, I am still having problem with it. I can't seen to take export nothing or if I switch around dbs.close and rs.close, I end up exporting whole subform (meaning all the selected text from all the records to on one word doc. I don't know what I am missing, and it has gone beyond the limits and I have turn my brain upside down, but still no answer :( It has to be something with coding. Because, I know my subform is working fine, if I print out a report on access. Help me out plz.

TIA



Private Sub Command4_Click()

'Declare the follwing
Dim dbs As Database
Dim objDocs As Object
Dim objWord As Word.Application
Dim prps As Object
Dim rst As Recordset
Dim blnSaveNameFail As Boolean
Dim BorrowerID As String
Dim InformationID As Long
Dim intcount As Integer


'Set word as an application and make it invisible
Set objWord = CreateObject("Word.Application")
objWord.Visible = True 'True is visible


'path and name of the template your are using.
objWord.Documents.Add ("C:Temp ermsheet3.dot")


'This is for the bookmark that you created in the template
objWord.ActiveDocument.Bookmarks("bmCusadd").Select

'This is the field in access that containts the data that has to be entered at the
'bookmark
objWord.Selection.Text = Forms![menu]![txtCusDetails]

objWord.ActiveDocument.Bookmarks("bmcoadd").Select
objWord.Selection.Text = Forms![menu]![txtcoadd]

objWord.ActiveDocument.Bookmarks("bmcoadd1").Select
objWord.Selection.Text = Forms![menu]![txtcoadd1]

objWord.ActiveDocument.Bookmarks("bmborrower").Select
objWord.Selection.Text = Forms![menu]![txtborrower1]

objWord.ActiveDocument.Bookmarks("bmborrower2").Select
objWord.Selection.Text = Forms![menu]![txtborrower2]

objWord.ActiveDocument.Bookmarks("bmGuarnator").Select
objWord.Selection.Text = Forms![menu]![txtGuarnator]

objWord.ActiveDocument.Variables("bmmoney").Value _
= Forms![menu]![txtloanamt]

objWord.ActiveDocument.Variables("bmpercent").Value _
= Forms![menu]![txtperc]

objWord.ActiveDocument.Variables("bmloanpur").Value _
= Forms![menu]![txtloanpur1]

objWord.ActiveDocument.Variables("bmloanpurpose").Value _
= Forms![menu]![txtloanpurpose]

objWord.ActiveDocument.Bookmarks("bmterms").Select
objWord.Selection.Text = Forms![menu]![txtterm]

objWord.ActiveDocument.Bookmarks("bmAmortTerm").Select
objWord.Selection.Text = Forms![menu]![txtamortterm]

objWord.ActiveDocument.Bookmarks("bminterestyear").Select
objWord.Selection.Text = Forms![menu]![txtinterestyear]

objWord.ActiveDocument.Bookmarks("bminterest1").Select
objWord.Selection.Text = Forms![menu]![txtinterestrate1]

objWord.ActiveDocument.Bookmarks("bmsecurity1").Select
objWord.Selection.Text = Forms![menu]![txtsecurity1]

objWord.ActiveDocument.Variables("bmsecurity2").Value _
= Forms![menu]![txtsecurity2]

objWord.ActiveDocument.Bookmarks("bmsecurity3").Select
objWord.Selection.Text = Forms![menu]![txtsecurity3]

objWord.ActiveDocument.Variables("bmsecurity4").Value _
= Forms![menu]![txtsecurity4]

objWord.ActiveDocument.Variables("bmworkfee").Value _
= Forms![menu]![txtworkfee]

objWord.ActiveDocument.Variables("bminsurance2").Value _
= Forms![menu]![txtinurance2]

objWord.ActiveDocument.Bookmarks("bmperdebt").Select
objWord.Selection.Text = Forms![menu]![txtperdebt]

objWord.ActiveDocument.Variables("bminsurance1").Value _
= Forms![menu]![txtinsurance1]

objWord.ActiveDocument.Bookmarks("bmaudited").Select
objWord.Selection.Text = Forms![menu]![txtaudited]

objWord.ActiveDocument.Bookmarks("bmborrower1").Select
objWord.Selection.Text = Forms![menu]![txtborrower1]

objWord.ActiveDocument.Bookmarks("bmGuarantor1").Select
objWord.Selection.Text = Forms![menu]![txtguarantor1]

objWord.ActiveDocument.Bookmarks("bmBorrower3").Select
objWord.Selection.Text = Forms![menu]![txtBorrower3]

objWord.ActiveDocument.Variables("bmaccepteddate").Value _
= Forms![menu]![txtaccepteddate]

objWord.ActiveDocument.Bookmarks("bmGuarantor3").Select
objWord.Selection.Text = Forms![menu]![txtGuarantor3]

objWord.ActiveDocument.Bookmarks("bmdearmsmr").Select
objWord.Selection.Text = Forms![menu]![txtbmdearmrms]

DoCmd.SetWarnings False
DoCmd.OpenQuery "qmakInvoice"


intcount = DCount("*", "tmakInvoice")
Debug.Print "Number of Detail item: " & intcount

If intcount < 1 Then
MsgBox "No detail items for invoice; canceling"
Exit Sub
End If
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tmakInvoice", dbOpenDynaset)
With rst
.MoveFirst
Do While Not .EOF
BorrowerID = Nz(![Borrower ID])
Debug.Print "[Borrower ID]:" & BorrowerID
With objWord.Selection
.TypeText Text:=BorrowerID
.MoveDown Unit:=wdLine, Count:=2
'.MoveRight Unit:=wdCell
End With
.MoveNext
Loop
.Close
End With


With objWord.Selection
.GoTo what:=wdGoToTable, which:=wdGoToFirst, Count:=3, Name:=""
.MoveDown Unit:=wdLine, Count:=1
End With
dbs.Close
objWord.ActiveDocument.Fields.Update

'Word (or the document that you created with the template, will now open)
objWord.Visible = True


Set objWord = Nothing
'rst.Close
Exit Sub
'End With

End Sub

View 2 Replies View Related







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