PC Review


Reply
Thread Tools Rate Thread

Access Form: No content with JOIN source

 
 
peterfarge
Guest
Posts: n/a
 
      12th Jan 2010
Hello NG,

I have a form in Access 2003 with some Combobox and Textbox controls.
The form has a SQL Stmt as Datasource (click on the dark grey in the
Form and choose Properties and Data).
If I choose a simple SQL stmt like "Select * From X Where ID=AAAA",
where AAAA is a foreign variable, my form works. All data is
displayed. If I change the SQL to a JOIN stmnt I get nothing. The form
is complete blank. No Textboxes or Comboboxes are displayed. I mean:
Not only the content is missing, the controls itself are missing.

Do you have an idea how I could change this behavior?


Thanks

Peter

 
Reply With Quote
 
 
 
 
Dirk Goldgar
Guest
Posts: n/a
 
      12th Jan 2010
"peterfarge" wrote in message
news:83601bf5-d083-4ecc-a893-(E-Mail Removed)...
> Hello NG,
>
> I have a form in Access 2003 with some Combobox and Textbox controls.
> The form has a SQL Stmt as Datasource (click on the dark grey in the
> Form and choose Properties and Data).
> If I choose a simple SQL stmt like "Select * From X Where ID=AAAA",
> where AAAA is a foreign variable, my form works. All data is
> displayed. If I change the SQL to a JOIN stmnt I get nothing. The form
> is complete blank. No Textboxes or Comboboxes are displayed. I mean:
> Not only the content is missing, the controls itself are missing.
>
> Do you have an idea how I could change this behavior?



That generally means that two things are true: (1) your recordsource query
doesn't return any records, and (2) no records can be added.

Condition 1 is probably because you are using an INNER JOIN, and there is no
record in the second table that matches any record in the first table on the
join key. If that's what you expect, then change your join to an OUTER JOIN
(LEFT JOIN or RIGHT JOIN).

Condition 2 may be because the form's AllowAdditions property is no, or the
database is read-only, or the recordsource query is not updatable. There
can be a variety of reason that a query may not be updatable, including the
use of the GROUP BY or DISTINCT keywords (a totals query or a unique-values
query), as well as specific situations with complex queries. You can check
whether the query itself is updatable by opening the query (not the form)
directly as a datasheet, and seeing if you can edit or add records. There's
a help topic, "When can I update data from a query?" that discusses this
problem in detail and suggests possible solutions.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)

 
Reply With Quote
 
XPS350
Guest
Posts: n/a
 
      12th Jan 2010
On 12 jan, 14:38, peterfarge <peterfa...@gmx.de> wrote:
> Hello NG,
>
> I have a form in Access 2003 with some Combobox and Textbox controls.
> The form has a SQL Stmt as Datasource (click on the dark grey in the
> Form and choose Properties and Data).
> If I choose a simple SQL stmt like "Select * From X Where ID=AAAA",
> where AAAA is a foreign variable, my form works. All data is
> displayed. If I change the SQL to a JOIN stmnt I get nothing. The form
> is complete blank. No Textboxes or Comboboxes are displayed. I mean:
> Not only the content is missing, the controls itself are missing.
>
> Do you have an idea how I could change this behavior?
>
> Thanks
>
> Peter


This is 'normal' access behaviour. It has nothing to do with then
join. Try the simple SQL in such a way there is no data and you wil
see the same.

To avoid it check the number of records in your record source before
opening a form. If zero do not open the form and display a message
box.

Groeten,

Peter
http://access.xps350.com
 
Reply With Quote
 
peterfarge
Guest
Posts: n/a
 
      12th Jan 2010
Thanks Peter and Dirk I'll try it :-)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Row Source in Form crashes Access ryguy7272 Microsoft Access Form Coding 6 10th Apr 2008 05:04 PM
Row Source property on an Access Form mjpereira76@gmail.com Microsoft Access Forms 2 16th Jan 2007 11:51 PM
Access XP form + view with join + SQL Express + add record Gabriele Bertolucci Microsoft Access ADP SQL Server 0 24th Mar 2006 03:09 PM
Can I have more than one record source on my form in Access? =?Utf-8?B?Y3RhdGU=?= Microsoft Access Getting Started 1 8th Sep 2005 04:37 PM
possible join visual basic net form and c sharp join?? jose Microsoft Dot NET 2 6th Nov 2003 04:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:33 PM.