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.
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?
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.
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 .
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.
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
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.
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.
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.
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.
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"?
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?
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.
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
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
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.
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
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.
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.
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.
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.
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.
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]
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