combo box clearing after entry
-
- 5StarLounger
- Posts: 1148
- Joined: 08 Feb 2010, 21:27
Re: combo box clearing after entry
Thanks Hans, i am off to bed now, i will investigate further in the morning.
-
- 5StarLounger
- Posts: 1148
- Joined: 08 Feb 2010, 21:27
Re: combo box clearing after entry
I dont know if this helps but it is an Access 2003 FE to a SQL Server 2005 Express BE.HansV wrote:I am very sorry, but I fear I can't solve the problem of the combo box for you.Pat wrote:Yes i can edit that field, i can also add a record in the query too.
-
- Administrator
- Posts: 78488
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: combo box clearing after entry
If I could, I would dearly like to help, but I really don't know what causes this problem.
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 1148
- Joined: 08 Feb 2010, 21:27
Re: combo box clearing after entry
Thanks Hans, I have decided to go back to a database before I started all these changes. I will save the database after every change and see what change does it.
I appreciate your insights and help. I'll keep you posted.
A question here though, I notice that the original query had fields from 2 tables that were populating the form's controls, what happens if you try to add a record with these 2 tables, will it create an entry in each table,or do i need special code in the Form_AfterUpdate to do this?
I appreciate your insights and help. I'll keep you posted.
A question here though, I notice that the original query had fields from 2 tables that were populating the form's controls, what happens if you try to add a record with these 2 tables, will it create an entry in each table,or do i need special code in the Form_AfterUpdate to do this?
-
- Administrator
- Posts: 78488
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: combo box clearing after entry
It depends on the exact structure of the query, and that the tables are in a SQL Server database may also play a role, so I'd experiment - go to a new record in the form and enter some values in fields from both tables, then close the form and go to the tables to see what happened...
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 1148
- Joined: 08 Feb 2010, 21:27
Re: combo box clearing after entry
The reason i got into this pickle is that i inherited this database from 3 developers before me, they had code in there that i thought i had better use, silly me. I am now going to ignore what they have done.
I went right back to the database on 9/7/10 and viola, it writes 2 records one to each table.
I now have a good starting point.
Thanks for your patience and time Hans, it really is great having people to bounce these things off.
I went right back to the database on 9/7/10 and viola, it writes 2 records one to each table.
I now have a good starting point.
Thanks for your patience and time Hans, it really is great having people to bounce these things off.
-
- 5StarLounger
- Posts: 1148
- Joined: 08 Feb 2010, 21:27
Re: combo box clearing after entry
With this coding above, can I get the file title as you can in the common dialog code?
-
- Administrator
- Posts: 78488
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: combo box clearing after entry
In the common dialog, FileTitle returns the name of the selected file without the path. There is no separate property for that in FileDialog, but you can easily extract it from the full name:
Code: Select all
Dim strFile As String
Dim intPos As Integer
Dim strName As String
With Application.FileDialog(msoFileDialogOpen)
.Filters.Clear
.Filters.Add "Text files", "*.txt"
If .Show = True Then
strFile = .SelectedItems(1)
Else
MsgBox "No file selected!", vbExclamation
Exit Sub
End If
End With
' Extract the file name from the full name
intPos = InStrRev(strFile, "\")
strName = Mid(strFile, intPos + 1)
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 1148
- Joined: 08 Feb 2010, 21:27
Re: combo box clearing after entry
I misunderstood what the title meant.
That's easy eh.
Thank you.
That's easy eh.
Thank you.
-
- Administrator
- Posts: 78488
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: combo box clearing after entry
If you want to set the title (caption) of the dialog window, use the Title property. You can also customize the caption of the main button in the dialog by setting the ButtonName property:
Code: Select all
With Application.FileDialog(msoFileDialogOpen)
.Title = "Please select a file"
.ButtonName = "Click Here"
...
Best wishes,
Hans
Hans