Idiot Proof Form Tutorial No 6


Hello. I am following the Idiot proof Tutorial and have got to Tutorial No 6. with regard finding Data. And have struck a problem. The search box is displayed but when i click Ok the data is not displayed on the Form  Instead I get a Header displayed where a name should go and nothing else. Can you help. Also for some reason best known to Excel I cannot seem to get the Form to clear either, it worked upto Tutorial 5.

I have included the Excel Database with this file, with the VBA code. I have not hidden anything as yet but the Form is Protected the passcode is written on the worksheet to the right of the Form. Having followed this series so far I am hoping that this continues in the future. 

The ID number I am using is already in place on the worksheet, and application forms received go by the date of the application in the next available space, once entered onto the Form then submitted the data copies to the "Entries" worksheet then onto the start sheet etc. 



Selected Answer

This is Don's baby. Surely he will be glad to respond soon. Meanwhile, I suggest that you enter Option Explicit at the very top of each of your code modules, before any declarations or procedures. This will cause VBA to highlight some of the mistakes in your coding (missing declarations and typos). You are missing the declaration Dim Rng as Range.

The code line Set Rng = dataIdCol.Find(What:=seachValue not only contains a typo in seachValue (which Option Explicit will highlight for you immediately) it also contains a syntax error. The line should end on , _ (comma, space, underscore), like this Set Rng = dataIdCol.Find(What:=seachValue, _

Your code line recordRow = Rng.Column contains a logical error. Why would a variable called "recordRow" hold a column number? Change it to recordRow = Rng.Row and most of your problems should be resolved.



Thanks Variatus, I studied the coding over and over and never picked up on the Typo. And your last comment all sorted .I thought that I had chenged that back to Rng.Row not left it at Column. I had tried that to see if it worked.  
Jim W (rep: 14) Jan 2, '19 at 10:32 am
Sorry for the delay in responding, finally back alive again lol. If you have any more issues, feel free to ask!
don (rep: 1745) Jan 3, '19 at 12:06 am
Thanks Don, that is no problem I hope that you enjoyed your New Year Celebrations, anyway Happy New Year 
Jim W (rep: 14) Jan 3, '19 at 11:52 am
Add to Discussion

Answer the Question

You must create an account to use the forum. Create an Account or Login