|
-
Jul 18th, 2005, 08:24 AM
#1
Access - Not saving a record
I have a form, which populates itself based off of a table called "WorkerInformation".
Everytime I change the record and switch to a new record, it automatically saves (obviously, because I am editting the record..), anyways, my problem is that I do not want it to save. Is there a way to do this? a little code snippet?
I was originally using ADO to populate the list so this wouldn't be a problem, but with all the calculations going on in the background, ADO kind of slowed down my program.
Any help would be greatly appreciated
-
Jul 18th, 2005, 09:29 AM
#2
Re: Access - Not saving a record
Gonna add another question as well: How can I make a report (using Access or Crystal, doesnt matter as I have never used either), and have a dynamic amount of labels to display information based off of a combobox on a form?
I am going to use ADO to search through a database, locating specific data needed for each person, and display it in labels. But I don't know how to make labels display on their own..as a normal report would do..
also..would it be easier for me just use the report wizard, link it to the table, and change the table during each query i run?
Last edited by kfcSmitty; Jul 18th, 2005 at 11:36 AM.
-
Jul 18th, 2005, 12:22 PM
#3
Re: Access - Not saving a record
*bump* Anyone? I am still stuck..Espescially on the report thing..I can display information from the form...but I cant get the labels to dynamically appear
-
Jul 19th, 2005, 08:10 AM
#4
Re: Access - Not saving a record
-
Jul 19th, 2005, 10:26 AM
#5
Lively Member
Re: Access - Not saving a record
i'd be *very* tempted just to either stick unbound controls on the form and load the values via the 'onCurrent' event, which makes for adding calculated controls very simple. or failing that just set the 'locked' property to 'true' thus you can select text and copy it, but cannot change it. you data datle is not somewhat safer.
as for the report, what *exactly* are you trying to do? if the data in your combo box comes from a data table your laughing, since access can handle a report that will grow or shrink depending on the number of records. if it isn't.. either build a dynamic recrodset and point the report at it.. or simply make a temp table, populate it and use that.
i've done the first bit with locked control, unbound forms etc frequently, reporting in access is something i do less often due to the problems getting the report out.. depending on what sort of report you want its possible to write out (manually) either plain text, xml, html or something like a csv file and just import it into something else.
-
Jul 19th, 2005, 10:34 AM
#6
Re: Access - Not saving a record
the form, I have working fine 
its the report thats giving me problems. My combobox is linked to a table, however, that data is used to run a SQL select and pull information for calculations
I need to be able to put different varialbles in the report. That isnt really a problem. My main problem is having the labels 'reproduce' so to speak. I need one for each record/calculation I do. I can't see to figure out how to make them do that.
And you sir, get a rep for finally atleast trying to help me its getting my hopes up
-
Jul 19th, 2005, 12:35 PM
#7
Re: Access - Not saving a record
*bump again*
lets handle 1 problem first
Hows about just being able to move from record to record without it updating automatically
-
Jul 20th, 2005, 10:29 AM
#8
Lively Member
Re: Access - Not saving a record
if i read you right you have...
1, some data your presenting from a table or query
2, a variable amount of additional calculated data
and a requirement to show both, but *not* to show blank fields.
if this isn't a multi-user type thing i'd be very tempted to create a temp table for the calculations, and have a sub-report display the results. you can add a 'field' to the temp table for each result (with a suitable name).
alternatively actually create text labels dynamically on the report (i think this is possible) doing this you can do, well anything really.
Q: where exactyl is the report information comming from? it sounds almost like your trying to use the report engine to just write out calculations.
It *is* possible to have fields dynamically resize, with the contents of the field resulting from a function (e.g. a custom function) which could write out something like "Label: Result" you do lose some formatting information here though.
would it be possible to 'mock up' a report in something like a gif file, showing what is to come from where, i'm still not 100% sure exactly what your after,
as for moving from one record to another *without* updating.. if your calculations are not based ont he *reports* records but data held elsewhere (another form for example) they shouldn't update anyway.
-
Jul 25th, 2005, 07:46 AM
#9
Re: Access - Not saving a record
I figured out one problem (the report thing), all it took was like 6 lines of code :/
Does anyone know how to not save the data though? Is there like a noupdate command?
-
Jul 25th, 2005, 08:12 AM
#10
Re: Access - Not saving a record
Hmm in Access forms there are four propertys to do with browsing. One is that the data is read only.
I take it you are in VB? If so, perhaps there is a property of the main data control you can set so that it is read only (therefore changes won't be saved).
On the Access forms, check the properties, Data Tab. You need to click in the grey area around the form back bit. There are four options (these can be reset via code I believe although I do not use bound forms so I wouldn't know if it would actually work!).
Allow filters, Allow edits, allow additions and allow deletions. Via code or if it is the reports read only form then in design: Set these to no (false?).
If you mean that the form is linked to a table, and the filters that are entered are some how saved... and you don't want them to be, can you just not link the textbox to the field... Ie make it unbound? Or is it something else?
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Jul 25th, 2005, 10:00 AM
#11
Lively Member
Re: Access - Not saving a record
its also possible to simply set each control to "read only", this way you can alter the value with code, but the user can't. it can be useful to alter what is 'read only' on certain forms, e.g. depending on the user etc enable or disable the ability to alter various things.
of course without spending ages in table & query design its very easy to make a form you can't update even if you want to without writing the update logic yourself.
-
Jul 25th, 2005, 10:12 AM
#12
Re: Access - Not saving a record
Thing is, I want the user to be able to change anything they want. I just want to ask them if they want to save or not. This works fine if I use ADO to populate the form...But this is a bound form and any change they make happens right away
-
Jul 25th, 2005, 10:22 AM
#13
Re: Access - Not saving a record
Use the before_update (has a cancel option in it) and a msgbox... If they change anything...
Events are on each control though, though you could feed to a singular function...
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Jul 25th, 2005, 10:36 AM
#14
Re: Access - Not saving a record
how would I call the cancel? I am used to .NET where its simply e.cancel = true
okay i figured it out...but if the user chooses not to save the record, it wont let them move to the next record...
*edit* the beforeupdate doesnt work..because then anytime someoen tries to switch records, whether they have changed anything or not, it prompts them to save
Last edited by kfcSmitty; Jul 25th, 2005 at 10:40 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|