15,664,081 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View Python questions
View Javascript questions
View C++ questions
View Java questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Gustav Brock (Top 30 by date)
Gustav Brock
7-Jan-19 4:52am
View
Great! Glad you got it sorted out.
Gustav Brock
4-Jan-19 12:00pm
View
That's very confusing. You should name your fields and controls to reflect the content.
If username1 holds a name that should match [Employees Extended].[Employee Name], you should bind the combobox to its second field/column, not the first - as it by default is.
Gustav Brock
4-Jan-19 11:44am
View
So ID is the name of the user? Normally, ID is a number (Long), and it doesn't match your SQL:
SELECT [Employees Extended].ID, [Employees Extended].[Employee Name] FROM [Employees Extended];
where, I guess, Name is the name of the user.
Gustav Brock
4-Jan-19 11:35am
View
If you declare the global variable as String, it will hold a string.
If tb_ID is a number, username1 should be declared as Long:
username1 = Me.tb_ID.Value
Gustav Brock
4-Jan-19 7:17am
View
Check what value it has and what value you try to assign. The value of a control and the caption of its associated label (if such one exists) are two different things. Value must match the data type bound to the control. Caption must be a string.
Gustav Brock
4-Jan-19 5:46am
View
What is the error? And what value do you assign it? And is that a valid ID?
Gustav Brock
4-Jan-19 5:09am
View
From within the form, you can do it anywhere. Above, I assumed a textbox, now the single code-line should read:
Me!YourCombobox.Value = username1
Gustav Brock
4-Jan-19 4:46am
View
If your combobox is bound to the first field, the ID, and username1 holds an ID (from the line: username1 = Me.tb_ID.Value), you should be able to assign this ID to the combobox and it will display the name.
To "reach" another object" from another table, adjust the query to have a JOIN to that table.
Gustav Brock
3-Jan-19 9:09am
View
It looks like your field is a combobox bound to the field. Then you (typically) must supply the ID of the username, but - from your code - that already seems to be the case and what is stored in username1.
Try a little debugging and check that you manually can enter the value in the table.
Gustav Brock
3-Jan-19 7:57am
View
I can see on SO, that you don't have a field but a label. For a label, assign the global to the Caption property of the label.
Gustav Brock
3-Jan-19 6:55am
View
OK. But you seem not to assign username1 to anything.
Gustav Brock
3-Jan-19 6:16am
View
It has. Perhaps you should reveal your code.
Gustav Brock
24-Jan-18 1:50am
View
Not related to Microsoft Access.
Gustav Brock
17-Nov-16 17:45pm
View
"I had created the project as a Web Application instead of Web Site."
Why didn't I think of that? It took me two days to resolve this simple mistake. Thanks!
Gustav Brock
29-Sep-16 16:36pm
View
The week cannot both start and end on the same weekday. It must start Thursday or end Tuesday. Except, of course but unlikely, that the end/start point is Noon, Wednesday. Please clarify.
Gustav Brock
29-Jun-16 4:50am
View
You would also have to double-check the value you try to update with:
rs(ctl.Tag).Value = ctl.Value
Gustav Brock
25-Jun-16 11:31am
View
I don't disagree with you, but sometimes a simple question needs a simple answer.
Just curious, but how would you inject a DateTimePicker control? Or rather: make it return anything but a DateTime value?
Gustav Brock
25-Jun-16 11:25am
View
Again?
Everyone can toss a link, and the questioneer certainly has an idea, only just misses the final detail.
Gustav Brock
25-Jun-16 9:02am
View
While your comment is right, it is not an answer.
Gustav Brock
20-Dec-15 4:20am
View
The only reason for your trouble was "Password" which is a reserved word, thus needs brackets, [Password] which, in general, are not needed.
Gustav Brock
26-Nov-15 2:44am
View
Reason for my vote of 5 \n Neat!
Gustav Brock
18-Nov-15 6:30am
View
That function believes all years contain 365 days which is not the case for leap years.
Gustav Brock
18-Nov-15 6:28am
View
This will never work - a birthdate is always back in time.
Gustav Brock
7-Nov-15 3:17am
View
Yes, what is the question?
Gustav Brock
21-Oct-15 6:56am
View
Yes:
Order By IIf(something = True, 1, 2)
Or nested:
Order By IIf(something = True, 1, IIf(Somethingelse = True, 2, 3))
Gustav Brock
16-Oct-15 9:39am
View
You are welcome. Have a nice weekend!
Gustav Brock
16-Oct-15 4:43am
View
Indeed. Most reports in Northwind.NET are controlled by parameters.
Gustav Brock
1-Oct-15 3:04am
View
That would be:
SELECT
ID, [Name]
FROM
tblYourTable
ORDER BY
([ID]-2) \ 3, ID DESC;
Adjust the subtrahend between 0 and 2 to control the sequence.
Gustav Brock
18-Sep-15 6:07am
View
I don't know why Dave believes DAO has been dead for 15 years? It is alive and well and has been and still is the preferred method in Access and VBA from version 1.0 through the upcoming 2016 (excluding one version many years ago).
That corrected, I haven't used DAO from within C#, but a little searching reveals this link which should get you going:
http://www.codeproject.com/Questions/208386/using-DAO-to-retrieve-access-data-in-Csharp
This link is in C++ (and also falsely mentions the death of DAO) - still it could give you some ideas:
http://www.codeproject.com/Articles/25209/Using-Data-Access-Objects-DAO-with-WTL
Gustav Brock
14-Sep-15 4:00am
View
Thanks. You may mark with a five-star. Note please, that I changed acSaveYes to acSaveNo which makes more sense as no changes are done.
Show More