Need a bit o' help - nothing big! [newb]

kingzl3y

Registered User.
Local time
Today, 06:43
Joined
Mar 20, 2008
Messages
20
Hoihoi,
Well, Hello..
Never thought I'd register on an Access forum, but, hey, why not!
I'm new to Access, never really liked it..but this assignment has changed me.. i really like Access and well DBA'ing in general!

I need a bit of help with a few things:
-----I hate registering on sites JUST asking for answers >< I hope to learn a lot of stuff from here!

-------Just like to add it's for an Assignment at college, i KNOW I KNOW you people can't help with assignment work, BUT it's not like i'm asking you to do it for me, just need a bit of help

Basically,
I've got a database -
It's based on a Mobile Library which visits nurseries.
The nursery can loan a book, if a book is currently being loaned by a nursery and another nursery wants to loan that book, they can reserve it untill it is returned.


Basically, I've got a few forms:
FORMS.JPG

I can do everything fine!
Everything seems to work, i can loan and reserve..
i can add books, nurseries and authors
..
HOWEVER
when it comes to deleting.. it's a different story!

On my delete_author form, I've got a Combobox which loads the authors and then i've got a Delete button which should delete the author which is in the combobox
---- I've google'd for ages..and can't make much sense of any of the replies people have had..



Is there anyone who can help me with this?

Delete the author which is in the combo box..

I can supply any details if people are willing to help :o

Would LOVE to hear a reply from anyone!

Cheers :)
 
For simplicity's sake - The delete button should use a delete query to delete the author from the table. Then you use

Me.YourComboName.Requery

to reflect the changes in the combo.

Now it can get more complex if you just want to remove them from the combo and not from the table. For that you would need to have some method of keeping an exclusion list - maybe a temp table for that then and base the combo's rowsource on that and then requery as necessary.

Hope that helps.
 
What method are you using to actually delete the author? Macro, code, something else??? How about posting the macro/code/whatever so we can see it and maybe offer a suggestion. Is it giving you an error? If so, what error?
 
Welcome to the site and the insanity that is Access. :D

I would add that you'll need to watch out for referential integrity. If you have it established between say books and authors, and you have a book listing Joe Blow as an author, you will not (and should not) be able to delete Joe Blow from authors.
 
Jebus!
Those were fast replies!

No boblarson, when i select the author from the combobox and press delete i actually want it to delete the author from the table.
I haven't really thought of that - haven't really used queries that much to know that either! I'll give it a bash!

RuralGuy,
I'm pretty sure i'm not using any code..
I didn't think i had to..but then when i thought about it knew i had to :' )
Which is why i asked for help on here..
Before,
I just had a combobox with got the authors from the authors table..and then i had a delete button which deleted that record..
BUT
i noticed it didn't delete the author i selected in the combo box..
Lets say i had 3 authors
1) Joe Bloggs
2) Paul Smith
3) Henry Lloyd

and i selected ID:3 Henry Lloyd - instead of deleting #3..it'd actually delete #1 Joe Bloggs..


pbaldy
Cheers dude!
Here's a pic of my relationships, and yes i have referential integrity selected
RELATIONSHIPS.JPG
referntial.JPG

Well, i'm not too sure what you mean, but with the method i was using before ( ^ ) it was deleting fine, but it was just deleting the wrong one :' )


Cheers for the help dudes!
 
Is the ComboBox moving the form to the record you want to delete? Did you use a wizard to create the Delete button? What version of Access are you using? If you look at the event tab of the properties sheet for the Delete Button you should see either [Event Procedure] or some macro name. We would need to see that code/macro.
 
Yeah, i created the combo box via the wizard.
I'm using Office xp/2002.

Well, that's what i would like to happen - the combobox selects the record, but it doesn't.

Here's the code..
Code:
Private Sub Command24_Click()
On Error GoTo Err_Command24_Click


    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

Exit_Command24_Click:
    Exit Sub

Err_Command24_Click:
    MsgBox Err.Description
    Resume Exit_Command24_Click
    
End Sub

Hope that helps :)
 
I'll attach my database.
Hope that makes it easier!

-Couldn't upload as a .RAR so i renamed the .RAR to .ZIP
Still opens, but if problems just renamed to 'whatever'.rar
:)
 

Attachments

Use the wizard to create a new ComboBox on your Delete form and this time select the 3rd option "find a record...". When the combo box is complete, using it should move the form to that Author. It would be helpful if you put at least the Author's name in a textbox control on the form so you could see what record the form is on.
 
AH, that's it dude!
Knocked it on the spot!


I've got another problem, well not problem..i want to make it more user-friendly.

Basically, when the user adds a book, they can add it easily..
the only problem is, when ..just say i want to add a book, and I have 10 copies of this book, I have to add the book first and the go into the ADD_BOOK_COPY form and then select the book which i want to add more copies of and click add - i repeat this for the total amount of copies that i have.
So if i had 10 copies of 1 book, i add, and then go into a seperate form and then click this button 9 more extra times.
Which, can cause headahces!


So basically, i'm thinking of implementing a new way to do this,
i was thinking about..
When i got to add a book, there's a List/Combo box with 1-20 into
So i can add the book, and then select how many copies, click 'add' and this will add 20 copies of that bookm firstly by adding it to the 'book' table and then adding 20 copies to the book_copy table..


Is there anyone who would like to help with this? :' )

Cheers btw!
 
You may want to start a new thread with that last post. This is a different issue and new threads attract new blood. ;)
 
Thanks dude!
Your above method worked perfectly!
Can Delete Books and Authors from tables :)
 
for once -- a student who is actually asking for help in a logical manner ..
:)
 
xD
I know, I never see any other students asking nicely.
They just demand you help them :')
Which is probably why half of their answers don't get answered.
 
You hit the nail right on the head! You were different so I chose to respond.
 
AH, that's good to know then!
Yeah, I've noticed on most forums, new comers just register, write a question and then expect every member to answer it :' )
I'm different, I know most people won't..
you've got to attract them :' )

OH, maybe you can help me on another question
- It's another newb one :'D
 
the other thing is, its clear you did/tried a lot of stuff yourself, before asking.

We all need help somewhere along the way
 
You're exactly right.
You can't just ask for help without trying stuff yourself..
where's the fun in that!
PLUS by doing so you might even find it out yourself....
Code:
IF 
answer_found  <> yes 
then
ask = yes
end if
</geek>
:' )
 

Users who are viewing this thread

Back
Top Bottom