I'm glad you got it working now, I will be here to help adding your main form, if you want. Let me know.
Printable View
I'm glad you got it working now, I will be here to help adding your main form, if you want. Let me know.
Thanks
Just doing some little things like;
In case the user clicks open
Private Sub mOpen_Click()
Dim myFile As String 'added
myFile = gMyPath & "\" & RoofBidder.txtLname & " " & RoofBidder.txtAddress & "RoofBids.dat"
If FileExists(myFile) = False Then 'FileExists in module
MsgBox "You have no saved roof bids" 'in case user delets all the bids
'MsgBox "No roof bids have been saved yet"
Exit Sub
End If
OpenFromFile
Populate_Grid
SetGridSize FlxGrd(2)
End Sub
i added the zip in case you see something wrong or needs improvement
Before anyone downloads it, you put some passwords in there maybe you should change the passwords at least, or if they are fake then its ok.
you go to Go Advanced just like you were adding a file Manage Attachments and click on the little x on your zip file
Attachment 118399
already 4 downloads, one of them is me so 3 more has the file :( maybe change your password
thanks followed your directions, selected the file then tried to leave,but was prompted to drag files they need a delete button.
i even tried selecting all, same result
Selecting all? no just the one in the bottom under Attachments just go over with the mouse and the X will appear where I made a red circle
Thanks only tried selecting all after selecting the one i wanted didn't work will try again
After i dragged the selected file an X showed in the top corner hopefully that will delete the file
Oh no don't go to add files when you click 'Go Advanced' new page load, go to Manage Attachments, then do not click add files just look at the window and look for Attachments, then you will see your file in there just remove it and click done
I reported you, you've been a bad boy, haha no just to remove the attachment, since you can't figure it out :)
I will look at your project in a little bit, not sure if I will be modify right away but at least have a look
Ok so you clicked edit on your message that has the file Post #62
Attachment 118407
Then you went to go advanced
Attachment 118409
then you go to manage attachments
Attachment 118411
Now you simply look at you attachment (where the red circle and arrow is), simply move mouse where I did the red circle and a x will appear
Attachment 118413
and then click done (where i did the other red circle)
Yep, you got it :)... ok I will post back whenever I do some work, in the mean time you can test the project for bugs or issues.
hate to bug you but somehow during testing, i have ended up with a blank row
can you modify this to check for a blank row FlxGrd(2)
Private Function Populate_Grid()
Dim i As Integer
Dim j As Integer
FlxGrd(2).Rows = RoofCompanyTotal + 1
For i = 0 To RoofCompanyTotal - 1
With RoofCompany(i)
For j = 0 To FlxGrd(2).Cols - 1
FlxGrd(2).TextMatrix(i + 1, j) = vbNullString
Next j
FlxGrd(2).TextMatrix(i + 1, Recap.CompanyName) = .CompanyName
FlxGrd(2).TextMatrix(i + 1, Recap.Estimator) = .Estimator
FlxGrd(2).TextMatrix(i + 1, Recap.sDate) = .sDate
FlxGrd(2).TextMatrix(i + 1, Recap.BidAmount) = .BidAmount
FlxGrd(2).TextMatrix(i + 1, Recap.BidMaterial) = .BidMaterial
FlxGrd(2).TextMatrix(i + 1, Recap.Bid2Amount) = .Bid2Amount
FlxGrd(2).TextMatrix(i + 1, Recap.Bid2Material) = .Bid2Material
FlxGrd(2).TextMatrix(i + 1, Recap.sqs) = .sqs
FlxGrd(2).TextMatrix(i + 1, Recap.BusYrs) = .BusYrs
End With
Next
End Function
Attachment 118421
It might not be the populate, but the delete function. If you could play around (save your file as different name) and start a new file then add fake entries and play with the delete button... delete the first entry, if all good delete the third entry and see, it might be a delete bug, I thought I got it to work good but maybe it still needs adjustment.
I can easily do a function to remove any empty lines, but this does not fix the issue, unless you simply add an empty line by accident.
So loop thru flxgrd(2).textmatrix(row,col),
This is not tested I'm on my phone, but it should work.Code:Private Function Delete_EmptyCompany()
for i = 1 to .rows
if Trim(flxgrd(2).textmatrix(i,0)) = vbNullString then
CurrentCompany = i - 1 'This will set the company to delete (for Delete_Company)
Delete_Company
end if
next
End Sub
I will check when I get a chance to see if it works, or you could try it :)
Thanks,
if i knew this could happen i would have paid better attention.
I have written code for the save
eg;
msgbox Name cannot be missing.
I did notice when testing that if all the companies are deleted the fixed row looses it's color
In talking to my sister who is getting landscaping bids i have made a few visual minor adjustments
eg;
changed label Roof Company to Company etc
unfortunately i can no longer upload as i have installed some purchased ocx's
http://www.namtuk.com/MyCommandButton-for-ActiveX.aspx
I will test your delete and try to recreate how the problem arose.
Thanks for your help
Too bad you had to purchase, I'm sure with all the code online and our help you could of free similar (if not the same) commandbuttons (or .ocx). I'm sure Olaf could of hooked you up with something nice with his vbrichclient5.
But now the ocx are yours I guess ;)
Well that's good that you are modifying to your needs, as long as you know what to change or not to change.
Since I have your project too (the one you deleted) I can still help you with some subs/functions as I know how your program is built (well most of it).
could not recreate the problem either in the one i am coding or the one you supplied
so it must have something to do with what i have done.
I have done stuff like added error handlers, prompted for dirty, removed the add button added it to save
Code to check if name field is blank and user click save they are prompted and no save occurs
also mbSaveFailed in case disk is full or ?
so i have decided to copy the code i have written to text file and it to yours carefully
I'm glad that it's working and that you are adding/editing what you need.
You understand how I programmed it better by now :)
I won't be too much on the computer for a couple days but I always have my phone so I'll keep checking in case you need help.
You might of added one with empty info and didnt see or realize before reopening it
When i test it I can't reproduce the error, not sure what is causing it.
I added my lastest version of the project, maybe I changed something which I don't think but anyways try to reproduce with this one. It saves/opens properly everytime for me.
Messing around with it I found out something that you might have done.
While editing the last number I left the txtedit focused (not validating it) and then clicked save and it did not save the last number
To fix this issue, you could add this to the save function
Code:Private Function SaveToFile()
Dim FF As Integer
FlxGrd(GridClicked).TextMatrix(GridSelRow, GridSelCol) = txtEdit.Text
txtEdit.Visible = False
If CurrentCompany > -1 Then
I think i may have added the 6th row to make the grids tops equal.
I think that adding a field to the udt may fix the problem
Private Type Phone_UDT
Cell As String
Office As String
Emergency As String
Fax As String
Owner As String
BottomRow as string
End Type
what do you think ?
Oh ok, your saving a 6th number? Well then yes you would need to make the udt bigger like you showed in the previous post. Remember that you'll have to change the load/save functions and populate to make sure it saves and loads it properly though.
Few yrs ago i had a udt in a project and found that trying to make some different fields, files saved with old udt would no longer open correctly.
As a work around i made a new udt with some extra unused fields eg; FutureUse1 as string, FutureUse2 as string. then depending on the exe version which udt was determined.
I am thinking of doing this to both udt's phones, tasks in case i wanted to make more rows
what do you think ?
Yes i forgot to tell you that it will mess up your saved file, unless you make a function to open the old file (with old udt) then load it into new udt and save you wont loose your saved information.
It is a good idea to add extra udt variables for the future.
Some thoughts/advice on modification
Seeing this project is still under development I had a thought. What if a homeowner wanted to save roofing bids then get bids on something else or even at the same time
eg; Kitchen remodel, landscaping, fencing or just about anything. Thoughts on a method to modify this project where the homeowner
could select a category or ? and show bids for that category,
maybe a combobox or ?
Would this be possible ?
Yes it could be possible, we would need to modify the user-interface a bit and the udt(s). You'd have to give me more information on what and how you want it to look/have.
Thanks for your reply
Good need to give it more thought.
Some initial thoughts
Replace the name textbox with a combo box that can be typed into
If I did away with squares textbox and the squares in main flexgrid, then everything would be the same.
If the owner wanted the squares they could put into notes.
I have made the notes textbox visible if it contains text when the user clicks a name, its position is also saved to an ini file
My initial thought is to limit the number of category's entered into the combo box to 10
maybe their is a better name than category's, eg; painting,fencing, deck build etc.
I am glad you are helping me I'm pretty good on what needs doing. it's the coding part I hit road blocks on.
Thanks for your help
Attachment 118567Thanks Max187Boucher
I can change the look, the functionally is what I am lost on.
I have added a combox (cboBids) to hold the descriptions of the bids eg Roofing, painting, fencing, etc
The user can type the name and all the details will belong to the name typed.
Do you want me to upload your last version with combo added and sqs removed ?
Yes you should post it, i will look at it when i can.
Attached the project with txtSquares removed actually i just moved to the left of the screen and made it invisible
I was thinking that the combobox will be populated with bid descriptions on form load eg;
painting, new fence,landscaping, etc selecting from the combo will populate the main grid with bids
Thank you
After giving more thought what if I included the cbo text as somehow part of the filename
Here is a typical file name i have now
C:\Documents and Settings\All Users.WINDOWS\Documents\RoofCalculator\Bids\Williams 1247 RiverBend rd RoofBids.dat
its set like this
MyFile = gstrBidsPath & "\" & ROOFBIDDER.txtLname & " " & ROOFBIDDER.txtAddress & " " & "RoofBids.dat"
maybe make a directory with the homeowners name and address
make another directory under the owners name-address called bids
put each cbotext under that
then on file open loop the bids directory and load into the combobox.
When a user clicks a name in the combo it will open the saved file and populate the main grid.
Of course if this is possible there would be more than 1 file.
What do you think ?