Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Macro (or VBA) to Auto_Fill Blank cells

Status
Not open for further replies.

dcanfield

Technical User
Apr 25, 2005
23
US
Hi,

I currently have a MS Access table that gives a field value when it occurs for the first time but not subsequent occurrences - ie. the blank cells underneath, in the subsequent rows/records are assumed to have the same value as above.

In essence I'm looking for a macro/global way of finding all such blank (Null) cells, and then using the function {Ctrl} + {' } where the cell I'm in is blank.



Thanks for any assistance you can provide.



David


 
I don't quite understand. Are you wanting the total number of fields that are null or empty? And if so what exactly are you wanting to do with them?
 
Hi Ascentient,

What I want to do is find all Null (blank) records of a particular field, and then fill in that field with the contents of the same field from the record right above it. (This is done manually by using the CTRL-' key combination).

Thanks,

David

 
I am sure there is an easier way but you could do the following

PsuedoCode:

Create a recordsetclone
rs.findfirst "field name" = null
do while ??
rs.moveprevious
grab contents of fields you want
rsmovenext
populate fields of null field record
reset hold fields
rs.findnext
loop

I hope this gives you a general idea. My expertise is not the greatest but this is how I would approach it since I do not know all the shortcuts, etc, VBA offers.

Hollar if you have any questions.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top