hey nick,
yea, i knew i had seen that allowzerolength option somewhere, thanks, the only problem is i keep getting this error when i set it to no:
Errors where encountered during the save operation. Properties were not updated.
I dont get this anywhere else and i dont know why this error is occuring. Any ideas?? Can i set this property through VB??(i know its a table setting)
I think im gonna stick with his design(the text for add and list for delete), the thing is Access is really bothering me with this whole saving empty or unwanted records thing. It seems if i exit a form with a bound textbox to a table and the textbox is empty or has any letter in it, it automatically saves a new record.(I know allowzerolength will stop the empties but what about the "p" or "a" or any other letter(s)). I have the form open a new record as the form opens itself, to facilitate automatically adding a vendor, but what if the user clicked in there by mistake, hit a key in the process and just clicks the exit button without caring or looking. So i set this code for when you click the exit button:
If [Form_Vendors].Text3.Text = "" Or [Form_Vendors].Text3.Text = " " Then
GoTo Exit_Exit_Click
End
Else
If [Form_Vendors].Text3.Text = [Form_Vendors].List5.Column(0) Then
DoCmd.GoToRecord , , acPrevious
GoTo Exit_Exit_Click
End
End If
Msg = "Do You Wish to Add " + [Form_Vendors].Text3.Text + " To Your List of Vendors?"
Style = vbYesNo
Response = MsgBox(Msg, Style)
If Response = vbYes Then
DoCmd.GoToRecord , , acNewRec
GoTo Exit_Exit_Click
Else
DoCmd.GoToRecord , , acPrevious
GoTo Exit_Exit_Click
End
End If
End If
I know it shouldnt work, theres nothing telling it to not save a record if theres an empty string(this should get fixed with the allowzerolength), then if the text matches the list, it should just go to the previous record and close, but thats not working(it doesnt match the text and list), and finally if its a new record, its supposed to ask if you wanna save it, but it saves it whether you click yes or no. hehe, so basically none of that works, but thats ok, cuz its 9:45 AM and i just finished programming it.
I figure this seems like a problem everyone should have encountered at some point in there Access life. But since ive never had any formal training in access, just reading help files, playing with samples and i just picked up "Microsoft Access 2000: Power Programming" by F. Scott Barker last week, im hoping someone knows how to deal with this.
On to the delete button,
Do you know if its possible to have the list box delete when multiselected or even in general for that matter??
I figure its something like:
DoCmd.FindRecord [Form_Vendors].List5.Column(0)
DoCmd.DoMenuItem acFormBar, acEditMenu, acDelete, , acMenuVer70
But I dont see that working with multiselect.
Well, thanks for your help nick, any ideas here would be much appreciated
Omar Qureshy
HI-Tek