docmd.openform and openargs making me crazy

Yes, what I came up with was that the author name that was entered was not how it was added to the table so that the acDataErrAdded was expecting to find the original data that was passed and it wasn't there because it was being parsed.

So, it seems that you should be able to requery the combo and then set the value to the new data. However, if the bound column is the ID number of the data then you will need to get that new ID number via a DLookup.
 
Yay!!!!!!!!!

okay, i found a solution that seems to work.

on another forum, someone was having a similar problem, and someone suggested that she change the RowSource of her cbo to SQL stmt rather using the query builder.

so now, my RowSource for the cboAuthor looks like this:
--------------
SELECT AuthorID, AuthorLastName & ", " & AuthorFirstName AS FullName FROM tblAuthor ORDER BY AuthorLastName, AuthorFirstName
---------------

I have no idea why that is different than what I had in the query, but these are the problems of a tinkerer.

Of course, if I have book by, say the MOMA, then I would have to enter it as some sort of LastName, FirstName (Museum of Art, Metropolitan), but I'll work on that later. At least now, I can ENTER books and someone else could to!

I have posted the working version. Thanks for everyone's help on this! I'm so glad I did this from scratch and it WORKS - however hackjobish it is!

Molly
 

Attachments

Excellent Molly! Thanks for posting back with your success.
 
Out of curiosity, how did this SQL statement differ from the SQL view of your other query that you build with the Query Builder?
 
that's my question too. i'm going to look right now...

-----------------------------
SELECT tblAuthor.AuthorID, tblAuthor.AuthorLastName, tblAuthor.AuthorFirstName, IIf([AuthorFirstName] Is Not Null,[AuthorLastName] & ", " & [AuthorFirstName],[AuthorLastName]) AS Author
FROM tblAuthor
ORDER BY IIf([AuthorFirstName] Is Not Null,[AuthorLastName] & ", " & [AuthorFirstName],[AuthorLastName]);
-----------------------------------------

that was the old one. i was trying to account for no first name, but i can't see that that would make the big difference. also, i just typed the SELECT etc right into the row source on the Data tab instead of invoking query builder.

since the adding authors is working now, i have another question. is it possible to NOT have the popup form? can it be hidden somehow so a user doesn't have to deal with it? it makes an extra step. i don't mind, but i feel that's it's not very clean when a mostly-useless popup form happens.
 

Users who are viewing this thread

Back
Top Bottom