sqlstr in a loop

oh totally. but for some reason the block technique wasn't working it crashed the form several times over amongst other things, and i can honestly say there was nothing wrong with the string itself as it was checked over and over by a number of people including myself.

i was told by my manager 'code already in that form is not liking the code your creating and crashing, it happened to me alot when i was working the databases'

the code already in the form i've been told to keep away from. If i want to edit any of it (some of it from what i've seen is beyond my grasp of VBA) it has to go through a whole prodecure, approved, by the MD, who happened to be the creator of the database... and a little over protective
 
Tell him "Even Driving Instructors crash cars...."
 
Honestly, whatever works.

I've attached a working copy of the concept you described, which updates fields at the push of a button; however, the fields are updated all at once as opposed to one at a time. Please feel free to use whatever you need from the database.

Thanks for the learning experience. It took me a few minutes to get this working.
 

Attachments

thanks, i'll download that and have a look at it.

This is just a first prototype of the database. theres more bits and pieces been and yet to be done.

i think this way is long winded, yet clever. probably not the most efficient but still like you say, whatever works.

you never know, your code might even get into the next prototype after i've looked and managed to understand it all.

right now i'm going to put my feet up :D
 
AW,

I'm a little late on this thread. I don't agree with the unbound field approach, but a little bit of
code can make it work.

Code:
Dim rst As DAO.Recordset
Dim i As Integer

Set rst = CurrentDb.OpenRecordset("Select * from YourTable Where PK = '" & Me.YourPKField & "'")
rst.Edit
For i = 0 To rst.Fields.Count - 1
   rst.Fields(i) = Me.Controls(rst.Fields(i).Name)
   Next i
rst.Update

hth,
Wayne
 

Users who are viewing this thread

Back
Top Bottom