Select Record/ Or Edit Record
Mar 11, 2007
Hi There,
I have a form 'Players' which has a field called Contact. When adding a new record to the Players form, the user has to select an existing contact or add a new one (they cant just type in a name).
(There is a contacts table)
So, i want a button next to the contacts field.I want it to:
1. If there is already a contact selected on the form, the contacts form open at this contact, so can be edited.
2. If there is no contact selected, the button will take the user to the contacts form, but will display the first record in the contacts table. From here the user can select the contact they want.
This is what i have (code below). With this code, if there is a contact already entered, the contacts form loads with that contact select, which is correct. However, if no contact has been selected, the contacts form opens with a blank record; whereas i want it to open at first record!
Private Sub Command90_Click()
On Error GoTo Err_Command90_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmContacts"
If Me.Contact = " " Then
DoCmd.OpenForm stDocName
Else
stLinkCriteria = "[Name]=" & "'" & Me![Contact] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
Exit_Command90_Click:
Exit Sub
Err_Command90_Click:
MsgBox Err.Description
Resume Exit_Command90_Click
End Sub
View Replies
ADVERTISEMENT
Nov 6, 2004
What I want to happen is ... in my order form
display a default record. ( a record of all products with suggested unit quantity
)
allow editing of quantity
then be able to save as a new record.
do I need a macro for this ?
any help welcome
thanks
View 1 Replies
View Related
Sep 19, 2013
I am attempting to create an attendance database that needs to be able to be updated if someone calls in sick.
I have created a cascading combo box where you can select a date up to 15 days into the past with the following code in the rowsource for cboDate
Code:
SELECT DISTINCT tblAttendance.dataDate FROM tblAttendance WHERE (((tblAttendance.dataDate)>Date()-15)) ORDER BY tblAttendance.dataDate DESC;
an after update event has been coded to show only employees who have been scheduled for the day
Code:
Private Sub cboDate_AfterUpdate()
On Error Resume Next
Me.cboAgentName.RowSource = "Select tblAttendance.agentName, tblAttendance.attendance,
[Code]....
So basically what i need to do is be able to use the cascading combo boxes to select the date and employee to go to that specific record so i can update the other fields. Currently when i attempt to do this with my current form, it automatically goes to a new record when i select a date and name and doesn't update the existing record.
View 1 Replies
View Related
Jan 3, 2014
I have created a form (races) with a subform (yachts in a race) to edit data in joined tables. It seems to be working well but I am having difficulty selecting which record to edit in the main form. I can scroll through the records until i get to the correct race but this won't work well when there are a large number of races to choose from.
I can see that I can use linked forms to select a race from a multi form or datasheet and call up my desired form by a double click on the ID field. This should work but isn't really elegant with users scrolling down a long datasheet to select the race record they want to work with. Is there a better way?
Races are uniquely identified by 3 attributes: SeriesDivision, Date & RaceNumber.I have created an index in the Race table for these 3 fields which forces them to be unique.I would love to create an interactive routine which asks users to select from a list for each of these 3 attributes and then returns the form for editing with the appropriate race record selected or even cascading - users select a SeriesDivision can then choose the valid dates for the selected SeriesDivision and can then select the valid raceNumbers for the selected date
View 1 Replies
View Related
Aug 9, 2014
I have a form which displays the records from a query (i have included a picture of this form) and allows me to filter them and create a report from the filter.
I'd like to be able to select a record with the record selectors (or preferably without) - and then go onto edit it in a new window and save the edit...
If possible also to select a record with or without record selectors and click a button to delete the record
searchdb.jpg
View 1 Replies
View Related
Sep 22, 2004
PROCESS AS DESIGNED: The user logs in and is given a form displaying existing records that are coded (by userid) for that user to update. From that list, the user selects a record and continues to a second form (the first form closes) which displays all the fields of the selected record which should/can be edited by the user (plus a few non-editable key fields). There is nothing tricky to how the records are selected for display. A simple query behind the first form selects data records using the userID number. The second form does a simple record select using the active record ID number on the first form. Nothing tricky -- no modules just queries, tables, forms and simple macros to string it all together.
The user can open/close these two forms as often as necessary and the record will continue to show up until a value is entered into a "completion date" field. When that field is no longer blank, the record will no longer be displayed for use.
PROBLEM: About 90% of the time, things work as expected. But 10-15% of the time, somewhere between opening the record in the second form and closing the second form, the edited record totally disappears (as if it were never opened, it isn't even system date stamped) and the input information is inserted instead into a brand new record.
Users can sometimes tell when the edit record is dropped during processing, because key fields displaying previously entered data go blank and the displayed recordID (autonumber) is changed. p>
ERROR PATTERN: NONE! It can happen as the edit record is first opening, in the middle of editing the form, or at the end when closing the form. It will happen on a specific PC 2 times in a row and the third time be fine. It has happened at multiple locations but not for all people and not consistently for the same person/same pc. The same record that failed can be re-selected and work just fine the next time.
I cannot reproduce the error myself. I have tested everything I can think of without causing the error. I can lose changes and avoid a system date stamp if I abort my Access sesssion, but that doesn't create/insert a new record with my new input. It just loses everything.
I have wondered if a momentary break in the network/communications could break the connection to the application to just enough that the form remains on the screen, but selected record is discarded. Input into the empty form would/does insert a new record.
I have asked the IT Operations group to investigate if a network/communication problem could be the culprit, but they haven't gotten far on this. I have never seen this happen before and am totally stumped but am desperate to resolve it before user confidence is damaged.
View 1 Replies
View Related
Aug 22, 2013
I have a form that using "Query A" as data source. The Form need add (edit) a field value before save that Query Result to another Tabel. Is it possible to do that?
The PROCESS simply like below: Tabel A --> Query A --> Form -->Edit value a field -->Save to Tabel B
if it is possible, are there some requirements that have to be fullfilled?
View 2 Replies
View Related
May 12, 2005
I have a table called tblFinishedGoods. There are 3 fields in the table:Serial Number, Model Number and Location.
I would like to have a form that will take input from my barcode reader and input the data for the 3 fields, if the serial number is not already in the table.(I have this already working).
But now I would like the same form to also check the table for any serial number that is scanned in...and if it is in the table already, have it bring up the model number and location for that record.
I'm thinking maybe there is something I can do with Serial Number afterupdate. Basically I'm looking for a way to not require the user to input anything via a mouse or keyboard.
If the 1 form could accept the 3 scans:Serial Number,Model Number and Location, and either 1)enter a new record if that serial number isnt in the table or 2)find that the serial number already exists and overwrite the model number and location with whatever the next 2 scans are.
Thanks
View 2 Replies
View Related
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
Apr 5, 2007
hi guys,
some background on my data:
i have a table that holds Electronic Gift Card details (those plastic store gift voucher cards). it holds all details of every transaction for every card, so the card number, activations, redemptions, dates, times, transaction values etc. are all recorded in my table.
i have attached a small extraction in a spreadsheet.
a single gift card can have multiple transactions against it throughout its lifespan. there are sometimes error transactions, and i need to write a query that finds these error transactions (they are all flagged with a "1" in the [reversal flag] field, so that bit is easy) but then also then the next transaction that occurs on that card. this subsequent transaction will not be flagged with a "1", but is a reversal of the error and will have an "802" flag in the [transaction type] field.
each transaction is date stamped hh:mm:ss, but i don't know how to write a query that will
1) find gift card number that has a reversal code of "1"
2) find next transaction made on that gift card based on transaction time
3) check that subsequent transaction type is "802"
4) select both transactions
5) repeat for entire table
i can't seem to get the desired result just using a straightforward query, and i don't know much (or any!) VBA in access.
does that make any sense at all???
cheers
bazzason
View 7 Replies
View Related
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
Aug 8, 2005
Hi All,
I Built a form with a selectbox. On each form there a several records shown. After each record you see a selectbox wich you can turn on and off. Now, everytime I click on a selectbox it automatically goes to the first record on the screen, why is that? With this action I want the currentrecord to be modified, but can't figure out how.
I think it has something to do that an 'edit mode' is selected.
Does anyone know how? Thanks in advance.
View 8 Replies
View Related
Dec 31, 2005
Hi,
I'm new user here and I use Microsoft Access 2003 for my applications.
I use an mdb on a server (datas) and form on station over the network (application).
I would like to lock the record edit by user when this user press "modify" button and unlock the record when this user press "save" button to avoid with the other users modifying the recording.
Is it possible and how ?
Thanks for your answer.
View 1 Replies
View Related
Nov 15, 2004
I have a form based on a query that selects only the people working in a single office, and displays
various personnel data items. All of the data is contained in a single table. Whenever I update
any of the data in the form, I get a message saying that another user edited and saved the data
before I edited the data. Its rother annoying, and I can't figure out why it is happening.
The form is bound to the query, and a list box contains the names of the folks. A subform contains
the personnel data, and the two are connected by the primary key.
View 1 Replies
View Related
Apr 29, 2008
Hey Guys and Gals,
I have a form that has a drop-down box. When the form opens, all the records are shown. Once a name is selected from the drop-down, only the records associated with that name are shown (a filter is created using code). The problem is that once the selection is made, I am unable to edit the records. I try to click in the fields but am unable to.
Any ideas? Thanks
View 5 Replies
View Related
Jul 19, 2005
I have a form that assigns an Auto Reference Number to each record. Now the records are later edited. Is there a way that I can have the user enter the Reference number and come directly to that particular record that needs to be changed in the form. Like a dialog box that asks Enter Reference Number or something.
View 2 Replies
View Related
Aug 11, 2005
I'd like to set up a form that allows you to enter a unique number for a record and then automatically change the value for one or more fields in that record.
I have a large number of records that I only need to add values to two fields so am looking to make a shorter form with the ultimate ail of doing this with a barcode reader.
I thought I could just add a line like:
Me.controlvaluetochangename.Value = "newvalue"
to and event property like after update and it would change the name for that record. Instead it created a new record with that value.
How do I go about changing the existing value?
Thanks
View 1 Replies
View Related
Jul 26, 2006
I have inherited a partially completed membership Access database which I
understand was originally generated from a load of linked FoxPro tables.
There is a form which uses multiple tabs, the first tab contains general
membership data (ie name, age etc) and this pulls data through from the
'Main' table in the database. Each of the other tabs includes a subform which
shows data held in a number of different tables linked to the 'Main' table
(eg, first tab - general data from 'Main table', 2nd tab - home addreses
from 'Home Address' table, 3rd tab - business addresses from 'Business
Address' table). All tables are linked to the 'Main' table through a common
'RegisterID' field. When I open the form I can query on any of the records
and amend and items of data on the various tabs them without any problem.
However if I add a new record using the >* option from the record navigation
I can add data to the first tab (ie. into the 'Main' table) but if I move to
the 2nd or 3rd tab I am unable to edit/add data to the fields on those tabs.
But if I save the record after completing the fields on the first tab and
then close the form and reopen it I can then edit the 2nd and 3rd tabs, can
you suggest how I can change the setup to allow editing/adding data to the
2nd and 3rd tabs without having to close the form and reopen it please. I
have checked the subforms and they are set to AllowEdit and there are NoLocks.
View 3 Replies
View Related
Mar 11, 2008
I have the following code on a combo box in a form that creates a new record in the table Products if it doesn't already exist:
Code:Private Sub comProduct_NotInList(NewData As String, Response As Integer) Dim strSQL As String 'Exit this sub if the combo box is cleared If NewData = "" Then Exit Sub strSQL = "Insert Into Products ([Product]) " & _"values ('" & NewData & "');" CurrentDb.Execute strSQL, dbFailOnError Response = acDataErrAdded End Sub
It creates a new record and inputs the appropriate value into the Product field, however then it goes to the next record and when I try to edit other fields, it does so on a new record.
So, for example, I wanted to set the Product field to ProductA and the Brand field to BrandB and the Size field to 200, it produces two separate records like this (code box used for formatting):
Code:Product | Brand | Size |ProductA BrandB 200
View 13 Replies
View Related
Mar 27, 2014
I have a continuous form with unbound controls. These controls write new records into a table using rec.addnew
If possible, I would like for the user to only be able to add/edit the new record only and not to edit the continuous form below. When I turn off edits on the form, I only get the new record to show. I found some pages that reference using code like .allowAdditons, .allowEdits and .allowDeletions but unsure of how to implement them since I have more than one control the user is entering data into. I also found another site that says to use a control to determine if the record is writable to: I do have a control that is set to =Date() on the default value.
View 13 Replies
View Related
Nov 19, 2014
I am trying to double click on a subform field called Address which would open a form frmEditWorkItem (based on a query qryWorkItem) then to be able to carry out edits for the current record.
This is my code line:
DoCmd.OpenForm "frmEditWorkItem", acFormAdd, acDialog, "ADDRESS = '" & Me.ADDRESS & "'"
This line does open the form but shows ALL records in the table instead of the current one that I have clicked in.
View 14 Replies
View Related
Nov 19, 2014
After running an append query, the form created displays a blank/new record. How can I make the form display and ready to edit the appended record.
View 3 Replies
View Related
Apr 23, 2014
MS Access 2010 accdb - Using TempVars open forms either for New Record or Edit Record.
Two sets of forms - One set works perfect but the other will not accept the criteria for New Record
MsgBox checks confirm the Variables are still valid in the 2nd form Open Event yet the If Then does not work.
Just before the If Then, an invalid use of Null message appears.
View 2 Replies
View Related
Sep 2, 2013
I am trying to create a duplicate of a certain record in a table so that the user can then edit the new record - or old record even as it doesn't matter - as long as one of them is original. The idea is that any revisions / changes are stored the user may of made.
View 2 Replies
View Related
Aug 19, 2015
I have a table called "Workorders" that I have created a split form for and have customised it so that it had combo boxes etc to enable the user to change the record data.I then needed to add some existing queries to the form so that I could calculate some totals from records in a few other tables. This all works fine EXCEPT that I can no longer change any of the fields in the records.
I am sure that it is something to do with the fact that the 3 queries I added to the form use the "Grouped by" option and based upon my Googling, this is probably the issue.Here is one of the queries:
SELECT DISTINCTROW [Workorder Labor].WorkorderID, Sum([BillableHours]*[BillingRate]) AS [Labor Total]
FROM [Workorder Labor]
GROUP BY [Workorder Labor].WorkorderID;
I need to have the totals and I also need to have the ability to change the data..
View 8 Replies
View Related
Apr 30, 2014
My database was working fine. Now, if I have to save or edit a record, I get a message Run time error 2107. The value you entered does not meet the validation rule defined for the field or control. I am able to enter and edit new records in the table. I did not change any validation in form. Then it goes to debug mode and highlighted this code (me.recordsource=Listsql - is highlighted)
Private Sub ListSearch_Click()
Dim dBS As Database
Dim Rst As Recordset
Dim Listsql As String
Set dBS = CurrentDb()
Listsql = "Select * from MasterData where employeeid ='" & [Forms]![MASTERFORM]![ListSearch] & "'"
[Code] ....
View 3 Replies
View Related