Select Record From List Box To Make Current

Mar 15, 2006

Hi. First of all, this is my first post, so tell me if I'm being stupid.

I have a simple form, 'BuildingID', which contains a list box and two buttons. The list box lists a field from the records in the table 'BuildingID'. The two buttons are 'Add Building' and 'Delete Building'. The 'Add Building' button works fine, but I cant figure out how to make the other one work.

I want to be able to single click one of the records in the list box, then hit the 'Delete Building' button to delete the entire record. So I'm guessing I have to somehow make the record that I click on in the list box current when I click on it, then have a standard delete record button.

If anyone can help I would be very greatful. :)

View Replies


ADVERTISEMENT

Make User Select From A Drop Down List If A Number In Another Field Is Entered?

Feb 13, 2006

Hi all, i have a 2 fields in a subform named "HRS_ABSENT" & "ABSENCE_REASON" i'm trying to create some code that will display a message if the user inputs any number into the "HRS_ABSENT" field & leaves the "ABSENCE_REASON" field empty. I want to force the user to select a ABSENCE RESON (these are 3 letter codes) from the drop down list, if they enter a number in the HRS ABSENT field. Ive tried the below code but it doesnt do anything :-(

Anybody please help me out?
-------------------------------------------------------------------------
Private Sub Form_BeforeUpdate(Cancel As Integer)
If HRS_ABSENT = >0 & ABSENCE_REASON = FALSE Then
MsgBox "Please select an Absence reason"
Cancel = True
End If

View 2 Replies View Related

General :: Shortcut Key To Select Current Record

Jun 2, 2014

I cannot remember (or find) a simple thing like the shortcut key for selecting the current record I am editing.

I have a form (or sub-form, or table even) set as a continuous form. I want to delete a record. I select the "record selector" on the LHS by left clicking on the grey box. I press [Delete]. No problemo.

I do not want my users to see the "record selector" grey box on LHS of my continuous form. I switch off record selectors. Now I am in edit mode, editing data in a field of my record. I decide I want to delete that record by using the [Delete] button. What is the shortcut key for selecting the record so that I can then press [Delete] do this, given that there is no "grey box record selector" to click on?

Same could apply in direct table view. No clicking on grey record selector box allowed.

View 1 Replies View Related

Forms :: Select Record From Combobox List And Have Record Populate In Subform

Sep 16, 2013

I would like to select a record from my combobox dropdown list and have that record populate in my subform. Currently, I am only able to select the 1st record at the top of the dropdown list to appear in my subform. But I would like to select any record from the dropdown list and have it populate my subform.

View 8 Replies View Related

Can I Use Combo Box List Out My Record With Going To The Current Record ??

Sep 5, 2006

Hi all,

Another problem bothering me. Wish someone can help me to solve it. I am doing the 'Edit' Option right now ... As a user friendly propuse, I had try to use a combo box to let user to choose my employee record with all the detail on but the problem is the program 'JUST' list the record they can not go to the current record!! When i try to edit my record, the program is not allow (for sure because they can't have a duplicate record on it). The reason is because the record just stay in the FIRST record but can not go to the current record. I do believe is the problem of i using the way of listing the record as below:
Me.EmployeeName = Me.EmployeeName.Column(0)
Me.IC = Me.EmployeeName.Column(1)
Me.Nationality = Me.EmployeeName.Column(2)
Me.Race = Me.EmployeeName.Column(3)
Me.Sex = Me.EmployeeName.Column(4)
Me.FMU = Me.EmployeeName.Column(5)
Me.Position = Me.EmployeeName.Column(6)
Me.SectionField = Me.EmployeeName.Column(7)
Me.DOEmploment = Me.EmployeeName.Column(8)
Me.DOResign = Me.EmployeeName.Column(9)
Me.Remarks = Me.EmployeeName.Column(10)

So, Could someone help me to solve it like when i can use the combo box to select the Employee record with the details are on as the same time can go to current record... Thanks alot!!!

i do have the confident if i can go to the current record then my edit option can be working properly.

P/S: I had attach the picture... showing my program problem (with the red circle)

View 8 Replies View Related

Select Current Record In Datasheet And Show In Main Form?

Aug 20, 2007

Hello everyone,
I have a query that runs from the main form when the command button is clicked. It displays the results in datasheet view. I want the user to double click a specific record and jump to that specific record in the main form. How do I do this? Sorry, if this is a dumb question. Please help, my boss is breathing down my neck. :eek: The main form is called Contracts. Each record has a unique ID.

Thanks,
Jason

View 11 Replies View Related

Modules & VBA :: List Box Current Record

Jun 18, 2014

I have a list box that my client goes through with vbKeyDown and vbKeyUp. When he finds the correct record he wants to do vbKeyReturn and capture the checktype code and description and have them placed in a check which is another form that is open. The following code does not work:

Private Sub List3_KeyDown(KeyCode as integer, Shift as Integer)
If KeyCode = vbKeyReturn Then
Forms!frmChecks![TRA{CODING =
Me.CurrentRecord.Column(1)
Forms!frmChecks![TRA:CODEDESC] =
Me.CurrentRecord.column(2)
DoCmd.Close adForm, "frmCheckType", acSaveNo
KeyCode = 0
End If

View 2 Replies View Related

Combo List Based On Current Record

Aug 23, 2007

I am designing a contact management system and have hit a bit of a wall. I am farily new to Access so please advise if I am going about this the totally wrong way.

I have three tables; Contacts, Companies, Company_Addresses

Contacts:
ContactID (P)
CompanyID
OfficeName

Companies:
CompanyID (P)

Company_Addresses:
CompanyID
OfficeName (P)

What I want is when adding a contact, to have a drop down list in the CompanyID field showing all the companies in the Companies table, and then in the OfficeName field, have a list of only the offices related to the company selected in the previous field.

I can do the first list, but cant work out how to list only data related to the company selected in the previous field. Any help would be greatly appreciated.

Sorry if this is in the wrong forum.

Thanks. James

View 4 Replies View Related

Forms :: List Filtering Based On Current Record

Dec 2, 2014

I currently have a form that only shows data based on a specific record id. I have placed a list into that form though that has multiple record ID's listed ( It's a log). How do I get a List to Filter to just the Record ID that corresponds to the current form Record.

What I have are as follows:

A form that has client information : Address, phone numbers, Etc.

On that form I have Pages. one of the pages contains a List.

That List however contains information from multiple clients based on Point of Contact ( Call Log)

What I want is a way to narrow the List to only show those that corresponds to the Current Client Record.

Is this possible? If my approach is wrong, which is a better way?

View 1 Replies View Related

Multi-select List Record Creation Code

Aug 5, 2005

I have a multi-select list box for selecting which faculty members apply to a project. The faculty table and project table are linked in a many-to-many relationship. I have the following code which should create entries in the link table:

Private Sub Command5_Click()
Dim varItm As Variant

rs.Open "tblFacultyLink", CurrentProject.Connection, adOpenDynamic, adLockOptimistic

For Each varItm In lstFaculty.ItemsSelected
rs.AddNew
rs!FacultyID = Me.lstFaculty
rs!EntryID = Me.EntryID
rs.Update
Next varItm

rs.Close
Set rs = Nothing
End Sub

It successfully creates new records and enters the EntryID and LinkID (autonumber). However, FacultyID is always left blank. lstFaculty is the unbound list box which has three columns from the faculty table and is bound to FacultyID. Any ideas on why FacultyID isn't created in the link table (I get no error messages)?

Also, any ideas on how to prevent duplicate links being created every time the button is pushed? I was planning on having it first run a delete query for that EntryID in the link table so that it replaces the old links and any that have now been unselected are no longer linked. Comments on that idea?

Thanks again to everyone on the forums for your help.

View 4 Replies View Related

Resetting A Mulitple Select List Box When New Record Is Created

Aug 20, 2004

I have created a form in access that contains a multiple select list box and a command button "New Record," that creates a new record. I select values in the list box for the current record. When I click on the "New Record" button, the values that I selected in the previous record are still selected. How can I reset the list box so that no values are selected when I create a new record?

View 8 Replies View Related

Multi-select List Box Selections For A Record And Re-selecting It?

Feb 1, 2013

So I have a multiselect listbox. The list that it shows depends on what is selected in a separate combo box.I want to be able to select multiple items from the listbox, and then be able to leave the record, and when I come back to it, to still have those items highlighted. Right now in my form, as I go through records, if I highlighted items 1,2 and 3 on a record, those first three lines will stay highlighted as I move through different records, rather than changing to what had been selected for each record.

I've already stored the actual selected values in a subtable. I just want to have it highlighted again so that you can see what was previously selected.

View 2 Replies View Related

Modules & VBA :: Programmatically Find And Select Item In Multi Select List Box

Apr 23, 2015

I have a multi slect list box (simple) and I need to find and select an item using vba - e.g., the bound column is the ID field and I need to select a specific ID (which will be different each time) as opposed to selecting the 100th record for example. How do I do this?

View 2 Replies View Related

List Box One Click Select/deselect With Multi Select

Aug 28, 2004

Hi,
is there any (reasonably simple) way to select or deselect multiple items from the List Box with individual clicks without using Ctrl key. Eg first click on an item would select it leaving all other items as they are, subsequent click on the already selected item would deselect it etc. I hope this is not too confusing and I would appreciate some help.
Thanks!

View 1 Replies View Related

Use Multi-select List Box To Filter A Report With Two List Boxes

Nov 20, 2013

Allen Browne's "Use a multi-select list box to filter a report" solution, in particularly with two multi-select list boxes? The code works fine for me for either box so long as I code it for one box alone. Combining the two into one code results in a type mismatch error. I'm trying to use the code to pass the contents of both multi-select boxes as Where conditions to a report. Both boxes are based on number fields. To try to isolate the problem, I've removed Allen's setDescription and OpenArgs conditions. We're unfortunately still on Access 2003 as the company desires to squeeze every dime by using until end-of-life next year.

Code:
Private Sub cmdPreview_Click()
On Error GoTo Err_Handler
'Purpose: Open the report filtered to the items selected in the list box.
Dim varItem As Variant 'Selected items

[Code] .....

View 14 Replies View Related

How To Transfer Multiple Select Item In List Box To Another List Box

Jun 2, 2012

How To Transfer MultipleSelect Item In Listbox to another Listbox ?

View 7 Replies View Related

Select From List BOX Of List Of Choices And Store This Into A Table

Aug 21, 2013

I created a form and created on it a list box which is a query that grabs certain number of fields from different tables. I would like the user to select from this list box of a choice and then store their selection into a table.This list box has three fields, but it needs to store the id rather than the item, the user would see the name of the item but the id of the item would be store into another table, called bid. It store all these three fields when a user selection one of the item from the list.

View 13 Replies View Related

Forms :: Select Record On Subform To Select Default Value In Combo Box?

May 6, 2014

I have a subform containing a list of Funds and attributes such as Asset Type, Fund Manager, etc.

Currently, I have a textbox, where the the control source is set so that it will be updated with the Asset Type from the subform.

I also have an unbound combo box that contains a list of Asset Types queried from a table via row source, where user can select the Asset Type.

What I would like is when a record is selected from the subform, the Asset Type is selected on the combo box as a default value. User can select another Asset Type if required. How can I do this?

View 1 Replies View Related

Perameter Query To Select Only Current Month

Mar 8, 2007

I have a perameter query that tracks everyone's time on different projects. When they click on the command button to run the query they are asked for the current start data and end date (this is loaded into the date field within the query on the criteria cell). When they click on this query I would like them to only be able to view the current month instead of any date range. The query is set up on a short date format and I have tried some diffent combinations but can't figure out exactly what to put into the criteria. Any help would be great.

Tim

View 5 Replies View Related

Forms :: Make Specific Textbox Become Current System Date To All Records

Sep 24, 2014

I have a problem in my Database system. The title of my Database is Employee Evaluation. This is my problem.. I already make the default value the txtbox a current system date. but for the next day.. the txtbox for all record should become a current system date. but only the for the new record is the current system date. the all records are not current system date... I want from the opening of my system the textbox of all records are should be current system date.

View 14 Replies View Related

Select Records With Date Inside The Current Month

Apr 20, 2007

I have a field named 'Date' and need to run a query that selects all the records where the date value is within the current month.

Anyone know how to do this?

View 3 Replies View Related

Forms :: How To Allow User To Select From Current Approved Values

Jul 13, 2014

I have a combo box that needs to only show approved values for any current data input but also be able to show legacy values (that were approved at one time but are no longer approved).How can I only allow the user to select from current approved values but still be able to pull a legacy record and show the legacy value.

Table structure

tblRepairReason
ID (Nnumber)
Name (Text)
ApprovedValue (Yes/No)

The recordsource of the combo box:

Code:

SELECT tblRepairReason.ID, tblRepairReason.Name, tblRepairReason.ApprovedValue
FROM tblRepairReason
WHERE (((tblRepairReason.ApprovedValue)=True));

View 14 Replies View Related

Modules & VBA :: How To Select Current Field For Module Call

May 29, 2014

I'm trying to monitor a few fields and record who updated them together with the old and new values, so far, I have this;

This does work ok, I was just wondering if there's a way of referring to the current field, rather than having to specify 'me.NPW.oldvalue' etc.

Code:
Private Sub NPW_AfterUpdate()
Call LogFieldUpdate(Me.AppNumber, "NPW", Me.NPW.OldValue, Me.NPW)
End Sub

[Code] ......

View 3 Replies View Related

Queries :: Make Boolean (Yes / No) Field With SELECT INTO Sql Statement

Nov 28, 2013

I've been using a SELECT INTO statement to import data from a linked text file into a temporary table in Access. Something along the lines of :

SELECT [tblLink].[fld1] AS Field1,
[tblLink].[fld2] AS Field2,
[tblLink].[fld3] AS Field3
INTO [tblTemp]
FROM [tblLink]

(There's an INNER JOIN in there and some Nz / CLng functions but just want to keep it simple...)

Now - I've just realised I also need to create a couple of extra 'dummy' fields in my temporary table (for later on in the show) and I need them to be Yes/No format (will set them to False at first, then run some separate queries later to update them)

I tried this :

SELECT [tblLink].[fld1] AS Field1,
[tblLink].[fld2] AS Field2,
[tblLink].[fld3] AS Field3,
False AS Field4,
False AS Field5
INTO [tblTemp]
FROM [tblLink]

But this sets Field4 and Field5 as Number fields, with each record given a value of 0. What syntax is required in the SQL to make these fields Yes/No rather than Number?

View 4 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 :: Records Using A Select Query That Is Sending To A Make Table

Feb 25, 2015

I have records using a select query that I am sending to a make table. I would like to have those records excluded from being used again for 180 days, at which point they can be used again. Essentially, I have an ID and an email address which gets stored in the Make Table. I would need to ensure that if we send an email out in Week 1, we do not send an email again for another 180 days if there is activity from that same ID. On day 181, the ID/email address can then be resent.

View 6 Replies View Related







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