Reset Answer Field in Test Database

I created a Q&A Test database (100 questions)...I would like to reset the 
answer field (StAnsr) and leave the remaining fields undisturbed.  Below is 
the code that I am using: 

Dim REC As Recordset
Dim RemString, workingdata As String
Dim DBS As Database
Dim Zero As String

Set DBS = CurrentDb()
Zero = " "
RemString = "Select [TstTkr2007tbl].[StAnsr] From [TstTkr2007tbl] WHERE 
([TstTkr2007tbl].[StAnsr] = " * ") "

Set REC = DBS.OpenRecordset(RemString)
RemString = Zero

While (Not (REC.EOF))
    REC.MoveNext
    
    Wend
    REC.Close
    DBS.Close

Any help figuring this out would be helpful...this thing is giving me fits...
0
Utf
11/27/2007 4:49:04 PM
access.formscoding 7493 articles. 0 followers. Follow

1 Replies
793 Views

Similar Articles

[PageSpeed] 51

No need for a recordset: use an Update query. It's almost always 
significantly faster to use SQL than VBA.

Dim strSQL As String
Dim DBS As Database

  Set DBS = CurrentDb()
  strSQL = "UPDATE [TstTkr2007tbl] " & _
    "SET [StAnsr] = Null " & _
    " WHERE [StAnsr] IS NOT NULL"
  DBS.Execute strSQL, dbFailOnError


-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"MNID13" <MNID13@discussions.microsoft.com> wrote in message 
news:EDC0281D-8CF5-494C-B410-634B17868442@microsoft.com...
>I created a Q&A Test database (100 questions)...I would like to reset the
> answer field (StAnsr) and leave the remaining fields undisturbed.  Below 
> is
> the code that I am using:
>
> Dim REC As Recordset
> Dim RemString, workingdata As String
> Dim DBS As Database
> Dim Zero As String
>
> Set DBS = CurrentDb()
> Zero = " "
> RemString = "Select [TstTkr2007tbl].[StAnsr] From [TstTkr2007tbl] WHERE
> ([TstTkr2007tbl].[StAnsr] = " * ") "
>
> Set REC = DBS.OpenRecordset(RemString)
> RemString = Zero
>
> While (Not (REC.EOF))
>    REC.MoveNext
>
>    Wend
>    REC.Close
>    DBS.Close
>
> Any help figuring this out would be helpful...this thing is giving me 
> fits... 


0
Douglas
11/27/2007 4:54:00 PM
Reply:

Similar Artilces:

Reset list
In Outlook2002 I can go to File, Open..., Other users folders... How can I reset that list so that it is empty? I have tried to delete the nk2-file but that didn�t seem to have any influence here. Regards Anette Open a lot of folders from someone else untill they are starting to fall of the list ;-) By recreating your e-mail profile the list will be gone. All info regarding this is kept in the registry; [HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles] Note that this key has never been created for manually editing so back-up the ke...

Export file to CSV delimited with fixed field length
Hi there! I have an Excel file with a series of fields, each in one column. What I need to do is determine a fixed length for each of these fields, so that when I export this file to a CSV file, I get a file in which each column has exactly the same fixed length. For example, if my Excel file contains: A B C 1234 ABC21 1234 and I want fields to have these fixed lengths: A - 5 B - 6 C - 4 my CSV file should contain: 1234 ;ABC21 ;1234 Any easy way of accomplishing this? I tried custom cells but when exporting, I lose the information. Thanks in advance. One way: http://www.mcgimp...

Calculated field to group numbers
I have a dataset that includes a field called Pymnt Days...data in the field represents the number of days that transpire between date of service and payment date. I would like to create a new field -- Pymnt Group -- that groups values in the Pymnt Days field. For instance, if the value in Pymnt Days is between 0 and 45, then the value in Pymnt Group would be 1; if the value in Pymnt Days is between 46 and 90, the value in Pymnt Group would be 2; etc., etc. Is there a formula I might create in an update query that would calculate the value for Pymnt Group? Thanks for any...

Populating the contactid field of the OpportunityBase table
I need to the ability to add the contact to the opportunity. I noticed that the OpportunityBase table has a contactID field. However I am not able to add this field to the Opportunity Form. How can I populate this field without using any kind of Query Tool? I have CRM 1.2. Thank You, --Jeff Actually I worded the above question incorrectly. I know that when you go to add the Customer you can add either an accoutid or a contactid. However, I would like to be able to add both since the cotactid will represent a Channel Partner and the AccoutID will represtent the actual account. Thank Y...

Ranking based on Multiple Data Fields
I am trying to Rank a field based on multiple sort criteria. My query sorts correctly, but the Ranking assignments are not correct. Could someone please review my SQL query and let me know how to correct this problem? I need to sort Descending by [Type2] AS WELL AS Descending by [Ext B/O] I used the following to assign my [Type2] field data: Type2: IIf([All BO]>=100 And [Host DN]>=20000,3,(IIf([Host DN]>=20000,2,(IIf([All BO]>=100,1))))) I am currently using the following to create my Ranking: Rank: (SELECT Count([VT].[Ext BO]) FROM [tmp_tbl_Chart5a_1]...

Outlook 2003 Message column headers keep resetting
I keep seeing the column headers in the messsages pane reset to their Inbox defaults. This is really frustrating when I want to find an email I've sent as the To & Sent fields keep disappearing, to be replaced by the From & Received fields! Changing these back via the field chooser is both annoying & tedious - is there anyway to fix this issue? Create a new custom view with the layout you desire and switch between the default and the new one to change the view. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Wi...

reset a combobox
hi i'm kinda new on excel. i want to create a button command linked to combobox; so that when i click on the button, it reset the combobox to nil. thxns in advance Girlie Set the Listindex property to -1 -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "girlie" <pris1_lee@yahoo.co.uk> wrote in message news:1159246903.687630.171770@d34g2000cwd.googlegroups.com... > hi > > i'm kinda new on excel. > > i want to create a button command linked to combobox; so that when i > click on the button, it reset the co...

Updating data in fields
Hi, I have several thousand records in MS CRM (leads and accounts), which contain fields like annual turnover, number of employees etc. In 12 months time the information in such fields will be out of date and I need to be able to up date these fields from an external source so that we can continually target our marketing activity based on fields like turnover, number of employees etc. Can anyone tell me how I update individual fields for a record using data from an external source? Best regards Lee Hi Lee, Scribe Insight will do this. It has a DBLOOKUP function so that you can search fo...

testing....1,2,3
"James Landon" <jlandon@pioneertool.com> wrote in message news:p6qdnYYqF8puELnVnZ2dnUVZ_jGdnZ2d@choiceonecommunications... > > microsoft.test is that way ===========> "Gordon" <gbplinux@gmail.com.invalid> wrote in message news:g0252h$tsf$1@news.mixmin.net... > "James Landon" <jlandon@pioneertool.com> wrote in message > news:p6qdnYYqF8puELnVnZ2dnUVZ_jGdnZ2d@choiceonecommunications... >> >> > > > microsoft.test is that way ===========> No, that way <=========== microsoft.public.test --=20 ...

Copy 2 fields from subform into new form
Hi, Really do not understand VBA. I want to copy the ID fields in a subform and paste them into a new form via a command button. Many thanks in advance Charlotte On Sat, 27 Feb 2010 16:22:01 -0800, Charlie <Charlie@discussions.microsoft.com> wrote: >Hi, > >Really do not understand VBA. I want to copy the ID fields in a subform and >paste them into a new form via a command button. > >Many thanks in advance > >Charlotte You'll have to give us a bit more context, I'm afraid! Are you working on the *design* of a form? or copyin...

reset
the mail incoming to irene ...

Merge an alpha field and a numeric field
I would like to merge an alpha field with a numberic field. Not sure it this is possible. Thanks How do you want to merge them - put the 2 results into another cell? Then you can use =A1&B1 (assuming the alpha & numeric fields are in A1 & B1!) Do you mean Merge Cells? If 2 cells both contain data, then merging them will only keep the data in the upper left cell. Bob Umlas Excel MVP "grams" wrote: > I would like to merge an alpha field with a numberic field. Not sure it this > is possible. > > Thanks Try =concatenate(a1,b2) "grams" wrote:...

fail when try to select field from an entity view
Hello, I have a problem when I am tryin to select a field from an entity main viewalthough I succeed to do that when I open a session from a the CRM Server. Can somone help to find an explaination. I should mention that even when I open a session from a client machine I use the administrator credentials Thanks in advance Try adding about:blank to the trusted sites in IE and check. HTH, Niths "Ahmed Maaloul" wrote: > Hello, I have a problem when I am tryin to select a field from an entity main > viewalthough I succeed to do that when I open a session from a the CRM >...

BUGS. i ll continue to repost this until one of MVPs answers
Dear Microsoft. I can understand programming bugs - you invent, you create, everyone makes mistakes etc etc. But how on earth can you have bugs in financial calculations? Take Finance 101 book. Replicate formulas. DON"T CHANGE THEM! I have already complained about mistakes in calculating bond yields in M2005 (has it been fixed?) where accrued interest is simply disregarded in calculations. Performance calculations in multiple currencies ARE ALL WRONG!!! here is example "buy" any asset in the account which is in a currency different to your base (say base is US$ and a...

How do I get Database Modeling Templates in Visio 2003?
I am not able to find the templates/stencil for Database Modeling in Visio 2003. Any help is greatly appreciated. Thanks. it's in the professional and enterprise architect versions http://www.microsoft.com/office/visio/prodinfo/diagramtypes.mspx#EKAA al "DK" <DK@discussions.microsoft.com> wrote in message news:3E5D1359-13BE-46C7-A668-86D88C14687B@microsoft.com... >I am not able to find the templates/stencil for Database Modeling in Visio > 2003. Any help is greatly appreciated. > > Thanks. ...

Invoking required fields, hiding/displaying
Hello All, I have 3 custom fields on the opportunity form new_add; data type = bit new_adjustedamount; data type = money new_previousamount; ; data type = money This is the logic and behavior I am hoping to achieve using the OnChange event of the new_add field if new_add = true then new_adjustedamount + new_adjustedamount = required fields AND estimatedvalue = new_adjustedamount + previousamount; I would also like to see about hiding and displaying the fields new_adjustedamount + new_previousamount based on whether or not the new_add is ticked or not. Not sure how to accomplish this. ...

Workbook reference is reset to [0] in chart data source spec
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Hi <br> I try to create some dynamic charts to a worksheet using named variables and it works great as long as I keep the workbook open, but when I close it and re-open it the workbook reference has been reset to [0] and the chart is not dynamic anymore. What do I do wrong? <br><br>In detail, this is what I do: <br> I define the names: <li> chtRange to =Variables!$B$4, where Variables!$B$4 contains =COUNTA(Pace!C3:CU3)<br><br><li> chtLen to =Variables!$B$3, where Var...

link xml document data to textbox fields in .net
I wish to write a program that will display xml data into texboxes. That is I write a xml document that has data and each node(s) would match up or assign to different textboxes.(etc.txtbox1,txtbox2...) Is there a way, if so I would like to know the code. ...

dates from database file won't reformat
I am working with data created from a database and saved as an excel file. The dates appear to be normal (ex. 12/1/03) but i nthe formula bar an apostrophe is shown. In excel these dates will not reformat with the usual command. How can I get this data to reformat to other date formats? Crystal Use DATEVALUE(A2) and format as required. Andy. "Crystal" <anonymous@discussions.microsoft.com> wrote in message news:0c5c01c3ba7c$7581fcb0$a301280a@phx.gbl... > I am working with data created from a database and saved > as an excel file. The dates appear to be normal ...

Migration: Migrated custom fields can't sync with plan
We migrated a set of enterprise global fields from 2003 to 2007. However, some of the post migration changes to these fields can't be reflected into project professional for all plans. Example, we have a project outline code in 2003 called Portfolio, which is a hierarchical set of values. In 2003, we allowed selection of non-leave node and didn't allow multi-selection. After migration, we changed the settings of the field to allow only leave node and multi-selection. However, these changes are neither picked up by migrated project plans nor newly created project plan....

Resetting
When ever I type an eMail it always comes out in red. How do I reset the color so that when ever I start to type it is in black. Thanks for your assistance. Stephen Reinstein SteveR7138@msn.com in outlook -- go to tools menu and select options click the mail format tab click the fonts command in the stationery and fonts section adjust to suit yer needs. "Steve Reinstein" <SteveR7138@msn.com> wrote in message news:usPEDdZfFHA.2644@TK2MSFTNGP09.phx.gbl... > When ever I type an eMail it always comes out in red. How do I reset the > color so that when ever I sta...

Field required
Is there a way to require something in a blank field on a protected document? I have a protected excell doc. and I want some way to require some type on entrey into each unlocked field. Some fields on the form are being left blank and I want some type on reminder to prompt users that there are still blank fields on the form Thanks tboyle I use an adjacent cell (or column of cells) with formulas like: =if(a1<>"","","Please enter something in A1!") And give that cell a nice bold red font. t848 wrote: > > Is there a way to require something in a b...

How to add a Lookup Field
MS CRM does of it own have fields of type "Lookup" Can you add Lookup-fields to the schema and use it in customized forms? Thanks Frank Rombaut :-( Not in this version. Stephen "Frank" <f.rombaut@citee.nl> wrote in message news:%23rz$mdmlEHA.592@TK2MSFTNGP11.phx.gbl... > MS CRM does of it own have fields of type "Lookup" Can you add > Lookup-fields to the schema and use it in customized forms? > > > Thanks > Frank Rombaut > > > > Hi Stephan, Thank you for your response. MS CRM just dropped a few points in my ...

GP database recovery mode
Hi, It appears that database created by GP appears to be in 'Simple' recovery mode. Is this by design? It prevents backing up transaction logs. For the time being, I’ve disabled the job that (attempts) to do a transaction log backup, and set the full backup job to occur every 4 hrs. Is there any way I can backup the transaction logs too. Thanks, Sri Sri, GP databases are created using the Simple Recovery Model by default, not by design. Which means that you can always go back to SQL Server Management Studio and change the database recovery model to Full Recovery Model. Once...

user defined fields
Cards-Sales-Customer, in lower left hand corner of the Customer Maintenance screen there are two user defined fields. one of our users would like to have User Defined 1 changed to "Tax ID/SS #". She should have been able to do this after looking at her user rights to "Tools-Customize-modifier" and "cards-Sales- Customer". loged in as "sa" and was not able to modify that same window. All I get is a greyed out Modifier / modify current window. ideas? Try going to Cards / Sales / Receivables and click on the Options tab. You will notice the...