General :: Preventing Changes And Additions Except Through Appropriate Form / Table?
Nov 9, 2012
While I was trying to test one of my forms (which was NOT working and I had to totally redesign it), I somehow created a bunch of stores in my Store Information table...some with no names, some with the first letter of an existing store, and there was even a duplicate of the store which is creating a problem now because some products exist in Store 1A and others exist in Store 1B.
I've created a query to identify the wayward products and am changing those. I'll delete that store then.
My issue is...can I set it so that the ONLY place a new store can be created is in the Store Information Input form? That if someone makes a typo when entering products, it doesn't create a new store?
Access 2010
View Replies
ADVERTISEMENT
Aug 15, 2013
Access 2007 - I am using the oft used, frequently posted and shard code from srfreemen - modified as below. now I know I sort of broke commandment # 8 - Thou shalt not copy and paste other people's code without at least attempting to understand what it does. but I honestly did try to understand what it does.
I keep getting runtime error 3078 - cannot find the input table or query 'tblEnrolment_Committee_Master'. It is the name of a table in my database but I am missing the very basic element of how to get my form (which draws all of it's fields from that table) to look it up or identify it.
Likely because of a silly basic error. Normally - I wouldn't attempt such things but my work needs me to ensure no duplicates exist in this case AND it's already a primary key - but I don't want to wait until the whole form is filled out for it to identify the duplicate!
How to get the tblEnrolment_Committee_Master to be included in the search and erase this error ...
Private Sub Entitlement_File_Number_BeforeUpdate(Cancel As Integer)
Dim SID As String
Dim stLinkCriteria As String
Dim rsc As DAO.Recordset
Set rsc = Me.RecordsetClone
[Code] .....
View 3 Replies
View Related
Dec 2, 2012
I am new to Access and have made a database for a shuttle company that keeps track of their bookings. I need to prevent from the same booking being entered twice. I have a "Booking Form" that was made from a table "Master List". I was wondering if there was a way to compare three of the fields and if they match then a error would pop up.
I think if the "client's name", "booking date", and "pick up time" matched then a "booking already exists"... and also there are four different people can enter data and they have a log in form how can I get their "username" to be put into a field on the "Master List" automatically...
View 1 Replies
View Related
Aug 22, 2007
I'm a self confessed newb and need help
Bascially trying to get 2 table entries to add together, now I get the 2 fields to view in the 1 entry I want them into but not as an addition
For instance
strPacket24 might have a value of 1726
strPacket48 might have a value of 1725
Total should equal 3451
Problem is in the total field I get the following displaying
String I have tried using is
=Nz([strPacket24])+Nz([strPacket48])
- this displays 17261725
=Sum(Nz([strPacket24])+Nz([strPacket48]))
- this displays 18592300 ??
Can anyone help me out please?
View 2 Replies
View Related
Sep 27, 2012
I've got a database that allows all users to review an address register. If they find errors or mostly get updated information they have another form they can fill out to make the recommended changes. Only I have access to the main DB to make the change permanent.
The question I have is there a way for Access to send me a notification that someone has requested the change?
I know that sending an email is doable - in Access. However, that's not an option for our network here. I was thinking something along the command prompt "Net Send" command. However I've not been able to get that to work by itself - let alone within Access...
I have used VB code in the past to store what PC is using the database, I could modify that to alert me whenever I open the DB up from my PC. But I was trying to get away from having to open this particular DB up every day and check for changes.
View 2 Replies
View Related
Dec 5, 2007
I'm trying to add records to a junction table based on additional record added to one table via form in the many to many relationship.
Junction table = ClientAssociation
Main table = ClientMain (qry_NewClientNullAssociation identifies new record added)
Many to many table = Associations
I'm trying to do this upon clicking a command button that then opens ClientAssociation based on Client_ID. Then allows user to select mutliple associations (Asoc_ID) for Client_ID.
Here's what I have - I'm new at this...
Private Sub ClickAssociations_Click()
On Error GoTo Err_ClickAssociations_Click
'Open recordset with new client records
Dim db As Database
Set db = CurrentDb
Dim recClient As DAO.Recordset
Dim strClientID As String
Set recClient = db.OpenRecordset("qry_NewClientNullAssociation", dbOpenDynaset)
'Loop through new client ids
Do While Not recClient.EOF
strClientID = ClientMain.Client_ID
Dim recAsoc As DAO.Recordset
Dim strAsocID As String
Set recAsoc = db.OpenRecordset("Association", dbOpenDynaset)
'Loop through asoc ids
Do While Not recAsoc.EOF
strAsocID = Asoc_ID
'Open junction table and update records
Dim recClientAsoc As DAO.Recordset
Set recClientAsoc = db.OpenRecordset("ClientAssociation", dbOpenDynaset)
With recClientAsoc
.AddNew
!Client_ID = strClientID
!Asoc_ID = strAsocID
!CheckBox = False
.Update
End With
recAsoc.MoveNext
Loop
recClient.MoveNext
Loop
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_Associations2"
stLinkCriteria = "[Client_ID]=" & Me![Client_ID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_ClickAssociations_Click:
Exit Sub
Err_ClickAssociations_Click:
MsgBox Err.Description
Resume Exit_ClickAssociations_Click
End Sub
View 1 Replies
View Related
Nov 18, 2006
Hi All,
I have been searching and can't seem to find how to solve my problem. I have a sub form that allows adding new rows to a database. The detail contains a combobox and a few text fields. When I enter data everything works fine. However when I accidently tab into the next row (new blank row) and then try to get out of the form without adding a new row I get an error about "Index or Primary Key cannot be null" or something like that.
It is very frustrating because I can't exit the form until I add data to the new row and then leave without tabbing to much (thus creating another new row with no data).
How do I trap the new row and only allow the insert if it has data in it?
Thanks.
View 1 Replies
View Related
Mar 22, 2013
I have a form which acts as a search function for users looking to amend existing records. This is based on a query, where users enter a parameter (PolicyNumber) and this returns only the records which match the PolicyNumber in a form view. I have also added basic navigation buttons to move between all records with the same policy number. I have a problem in that I can't disable the option to add a new record in this form once people navigate to the end of the records.
The user clicks a 'search' button, manually inputs the policy number, and the records are returned in form view. The code for the button is as follows:
Code : DoCmd.OpenForm "frmAdjustmentsEdit", acNormal, "qryPolicyNumberSearchWriteOff", "", acEdit, acNormal
How I can disable the addition of records in this? Also as a sidenote if no records are found I would like it to display a MsgBox, but despite trawling the internet have been unable to find a solution I could get to work.
View 7 Replies
View Related
Dec 19, 2012
If I need to take the backend of my database offline for changes, what's the best/easiest way to inform the users? Is there some code I can drop into the front end? I'm thinking a "on database open, if [available] in tblClose equals no, then open frmDatabaseOffLine". But I don't know a) if that's possible or b) how to program it.
View 5 Replies
View Related
Jun 11, 2014
I have an Access 10 DB that includes 299 names and other associated data relevant to these names. I have a need to drop 249 of these names that are no longer needed in the DB, and just keep the 50 names that would remain in the table.
If I am in the table is there any way to somehow "designate" or select the 50 names I want to keep and then just mass delete the other 249 in one fell swoop? If I can somehow sort the 50 names so they would appear as the first 50 names in the table, then I could simply delete all the names below.
But not sure how to make this happen. It would seem to be the simplest solution. Unless I can physically drag and drop each of the 50 names I want to keep to the top of the table, but I don't think this is possible.
View 1 Replies
View Related
Sep 7, 2005
Hi
I have a Switch Board and when I click to view a report on it the report automatically opens in maximize view, this is what I want. What I dont want is when I close the report for the Switch Board form to be maximized as well
How would I be able to prevent this??
Cheers
bikeboardsurf :rolleyes:
View 2 Replies
View Related
May 28, 2007
Hi all,
I've got a database with a members table and an events table and a participation table which is like an 'intermediary table' which just has fields for MemberID_fk and EventID_fk.
The form at the moment has a combo box for Members and a combo box for events. This works well but the problem with it is that there is no safeguards to prevent a member from joining the same event many time.
Ideally i'd like for the combo box of events to be updated once the member's been selected to only include events the member has not signed up for.
If anyone's got any suggestions i'd love to hear them. The only constraint i have is that this has to be prevented when it is entered in the form.
Cheers,
Joe
View 3 Replies
View Related
Jul 11, 2006
Hi
Hoping someone can help me here. I have a form which is maximised on startup which also has the min/max and close button disabled. What i'd like to do is also prevent the user from restoring the form to ie. click the restore button which then makes the form smaller as i'd like the form to permanently remain maximised.
I'm not sure if this is possible, but if not is there a way to size the form to fit the height and width of the screen as if it was maximised regardless of the screen resolution the user is using.
Any help would be appreciated.
View 3 Replies
View Related
Oct 29, 2006
Hello again,
I have three questions this time 'round:
1. I'm in need of some way of preventing a user from opening form B unless he has entered information in form A.
Right now it is possible to open form B without entering data in form A (form A being the date/time info and form B being the case technical info) due to which a record is created for clientnr 0 (which should be a non existing client). Querying for clientnr 0 from time to time and deleting those records is easy enough, but who knows what kind of relevant data could be stored accidentally in a record that doesn't belong there.
This happens by the way, even though referential integrity is enforced throughout the dbase. Maybe I should say, because of that. I want to keep it that way of course to prevent orphans roaming around. But having orphans for clientnr. 0 is also not a good idea.
2. What is the wiser thing to do: keep all information concerning one case for one client (date/time info per case, techinfo per case, maybe even products sold info per case, payment info per case) in one table and have the data needed for each thing entered in seperate forms, or have all data split up into seperate tables like I have now. One for clients, one for dates and times, one for the technical info for that case etc.... ?
It is starting to seem a bit ehrm... useless to have all that data for one case floating around seperate tables. I don't know... it seems so much more complex (having to create multiple relations, multiple PK's per table etc.).
Where do I draw the line? For example the image attached (relationship2.jpg): now I have one PK in the table holding the clients (clientnr), two PK's in the table holding the case date/time info (clientnr and casenumberdatetimeinfo), three PK's in the table holding the techinfo (clientnr, casenumberdatetimeinfo and casetechinfonr). And what's next? Four PK's in the table holding the sold productsinfo? Five PK's in the table holding the invoice info? And what about the relations between those tables? Right now I can still comprehend.... but when I start thinking ahead, I'm starting to get dizzy. So some advice on this would really be highly appreciated.
3. Which build up of the relations between the tables in the dbase is better? The one in relationship.jpg or the one in relationship2.jpg?
View 8 Replies
View Related
Jan 26, 2008
I have validation logic that runs to test whether certain fields are inputted properly etc on my form. I call these methods in the Before_Update of each form. But How do i actually STOP the update from happening? OR how do i stop the form from being closed?
Right now, I just give all these warnings but the save still happens!
View 5 Replies
View Related
Mar 10, 2014
I'm using the following code to ask the user whether to save changes to the data, don't save changes or Cancel the close and continue editing. I'm closing the form using the 'X' only.
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim UserResp As Integer
UserResp = MsgBox("Record(s) have been added or changed." & vbCrLf & "Save the changes?", vbYesNoCancel)
Select Case UserResp
[Code] ....
The problem I'm having is when I press the 'Cancel' button in the message box. When I press 'Cancel' the form remains open (bPreventClose=True) which is what I want. But the changes to the data get undone even though I don't have Me.Undo in that case.
First, what's causing the undo?
Second, how do I prevent the data from undoing when I press 'Cancel.'
I went to add a record earlier and selected 'Cancel' because I wanted to change one small item. I lost all the data I had put in and had to start over.
View 2 Replies
View Related
Aug 11, 2005
Hello, All.
I have a table that collects training information for our company. Some training is limited to one or two employees and that is easily entered by using a form linked to the table. However, some training is mandatory, company-wide training that all employees must attend. How can I add a record for each employee reflecting this training most efficiently? Is there a way to do a mass update?
Thanks.
View 3 Replies
View Related
Jun 21, 2005
I have a main form and a sub form. Tbhidden and tbpropersave are the text boxes that govern the update procedure. The main form has two text box that i use to prevent the user from modifying the information on the main form without clicking my custom save button. the problem is that the subform should be completed after the information on the main form has been filled in. The Update code i have refuses to allow me to complete the subform without first clicking the save button on the main form. Here is the code. I wana be able to fill in info in the main form, then the sub form then click save. The sub form is a table which relates to the main form table Many to One.
Private Sub Form_BeforeUpdate(Cancel As Integer)
On Error GoTo Err_Form_BeforeUpdate
Me.tbhidden.SetFocus
If Me.tbPropersave.Value = "No" Then
Beep
MsgBox "Please Save This Record!" & vbCrLf & vbLf & "You can not advance to another record until you either 'Save' the changes made to this record or 'Undo' your changes.", vbExclamation, "Save Required"
DoCmd.CancelEvent
Exit Sub
End If
Exit_Form_BeforeUpdate:
Exit Sub
Err_Form_BeforeUpdate:
If Err = 3020 Then 'Update or CancelUpdate without AddNew or Edit
Exit Sub
Else
MsgBox Err.Number, Err.Description
Resume Exit_Form_BeforeUpdate
End If
Please HELP
End Sub
View 1 Replies
View Related
Aug 13, 2014
What is the code for displaying warning message when enterenig duplicate information in unbound form in BeforeUpdate event procedure.
View 1 Replies
View Related
Mar 26, 2013
I have created an Access 2007 database that uses a form for data entry. While the data is stored on the table exactly as entered, the data entry form rounds up and only displays the whole number.
In the properties of that form field, I have the format as fixed, with decimal places as set to 1 and is visible. However, the number still rounds. What do I need to do differently to make the number display as entered on my data entry form?
View 1 Replies
View Related
May 17, 2005
I'm not sure if there is an easy way to do this...... Maybe someone has run into this problem. Have a DB.....Did a split...BE is on the server "F" drive.. fe is on stations. I retained a full copy of the DB NOT split. I still wanted to expand it. So now I have problems by working this way..I have not altered the tables that are on the "F" drive.. But I have added more tables to my unplit version. I need to copy the tables and info from the BE on the server BACK to my full DB. Then split it again. IS there an easier way???????????
Thanks
View 1 Replies
View Related
Jul 2, 2007
I'm an Access idiot - please be kind :o
I made a little Access app for a friend, to do his invoices. Access wouldn't allow me to copy the db to a CD, but advised me to convert it to a Master. I followed all the instructions (honest!). Afterwards, I could burn his db to a CD and, on his computer, it opened but wouldn't allow edits or new records - not terribly helpful for an invoicing program :eek:
Since then I've tried creating a new admin in his name, re-setting all permissions, blah blah ... Basically, it looks like there is loads of help on securing a database but very little on un-securing it enough to be transferred to another PC!
The dang thing persists in allowing everything except edits & additions :confused:
I can't find out how to convert it back from a Master to ... what, a slave? :p
Even so, that wouldn't be the answer coz I'd be back at square1.
I use a PC running XP and Office 2003. My invoice-less friend has a PC with Win[NT]2000 and Office 2000. I converted the database to Access 2000. I am way out my depth here, but hoping you Access swimmers will be able to advise :cool:
View 1 Replies
View Related
Aug 1, 2006
I want to have a dropdown box in a form but allow additions to be made, but after they are made, instead of them not showing up in the box like usual, I want them to become a part of the list. Plz help! Thanks
View 9 Replies
View Related
Apr 2, 2006
hi,
can anyone tell me how to stop additions and edits on a particular record in a form, plus the subform that the main form contains,
im trying to put the event behind the change of a text box, shipped date, so when its changed you cant add or edit the record which is the order.
cant anyone point me in the right direction?
cheers
View 1 Replies
View Related
Aug 13, 2015
I have Table for rooms called Rooms, and the data in the table is roomNumber which is in the format Letter and two Digit number, so A01 would be dorm building A and room building 1, and I then have a seperate row named roomType that is either VIP or Semi Private.
Now I am creating a form where a worker will put in there scheduledCheckin date and scheduledCheckout date and it will be written to the Bookings table. I would like this form however to take the dates they have put in, as well as room type (Semi-Private or VIP, and assign them an available room that isn't booked at all in that range) or list all available rooms for that range of time and they could then just select the room. I would rather it automatically assigns an available room based on room type though because this check in system is going to have about 500 rooms.
I've attached a link for what I have so far. I know how to make a query to list anyone who has booked rooms over that date, but need one for just preventing booking the same room.
[URL] .....
View 3 Replies
View Related
Dec 11, 2013
1. I have a table which lists all of the equipment we use in our company and would like to use it as a template in a form so that users can select a checkmark if the equipment is being used that day. The checked items would then be used to populate another table which records all of the equipment the user has selected. I thought the checkmark method would be best so that the user can scroll through the list of equipment and select multiple pieces for the day. The reason I don't use a multi-value field is so that the user can also enter quantity and hours of equipment used in the same table when they scroll through the list.
2. Once all of the equipment pieces have been checked, I would like the user to be able to click a review button which would navigate to the next form with all of the selections for the day. This new form will have the option to go back to the first form if any corrections need to be made. And also have the option to submit the results.
3. Once the user is finished with their selections, the user can then select Submit which will finalize the recorded equipment table and clear the checkboxes and any inputs from the equipment template table (without modifying anything) so that it can be used for the next day and so forth.
I am using access 2013...
View 3 Replies
View Related